[add] ansible deploy
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
build/
|
||||
/build/
|
||||
target/
|
||||
src-gen/
|
||||
out/
|
||||
|
||||
11
ansible/ansible.cfg
Normal file
11
ansible/ansible.cfg
Normal file
@@ -0,0 +1,11 @@
|
||||
[defaults]
|
||||
hash_behaviour = merge
|
||||
host_key_checking = False
|
||||
#callback_whitelist = profile_tasks
|
||||
display_skipped_hosts = False
|
||||
stdout_callback = yaml
|
||||
bin_ansible_callbacks = True
|
||||
|
||||
[ssh_connection]
|
||||
pipelining = True
|
||||
ssh_args = -o ForwardAgent=yes
|
||||
14
ansible/deploy.yml
Normal file
14
ansible/deploy.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- hosts: all
|
||||
vars:
|
||||
ansible_user: "{{ deploy_user }}"
|
||||
roles:
|
||||
- ansible-deploy
|
||||
- build
|
||||
post_tasks:
|
||||
- include_role:
|
||||
name: ansible-deploy
|
||||
tasks_from: complete.yml
|
||||
- include_role:
|
||||
name: service
|
||||
tasks_from: restart.yml
|
||||
2
ansible/dev/inventory.yml
Normal file
2
ansible/dev/inventory.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
all:
|
||||
hosts: localhost
|
||||
9
ansible/group_vars/all.yml
Normal file
9
ansible/group_vars/all.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
project_name: puzzlez
|
||||
project_user: holop
|
||||
|
||||
deploy_user: "{{ project_user }}"
|
||||
deploy_project: "{{ project_name }}"
|
||||
deploy_repo_url: "git@bitbucket.org:infernalgames/{{ project_name }}.git"
|
||||
deploy_repo_version: master
|
||||
deploy_npm: yes
|
||||
4
ansible/prod/inventory.yml
Normal file
4
ansible/prod/inventory.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
all:
|
||||
hosts: shmyga.ru
|
||||
vars:
|
||||
config_src: "/home/holop/puzzlez/config.json"
|
||||
5
ansible/requirements.yml
Normal file
5
ansible/requirements.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- name: ansible-deploy
|
||||
src: git@bitbucket.org:shmyga/ansible-deploy.git
|
||||
version: master
|
||||
scm: git
|
||||
2
ansible/roles/build/defaults/main.yml
Normal file
2
ansible/roles/build/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
config_src: "{{ deploy_release_dir }}/config.{{ inventory_hostname }}.json"
|
||||
config_dest: "{{ deploy_release_dir }}/config.json"
|
||||
11
ansible/roles/build/tasks/main.yml
Normal file
11
ansible/roles/build/tasks/main.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: "Copy config"
|
||||
copy:
|
||||
src: "{{ config_src }}"
|
||||
dest: "{{ config_dest }}"
|
||||
remote_src: true
|
||||
|
||||
- name: "Gulp build"
|
||||
command: "{{ deploy_release_dir }}/node_modules/.bin/gulp default"
|
||||
args:
|
||||
chdir: "{{ deploy_release_dir }}"
|
||||
@@ -22,7 +22,7 @@ const config = new Project.Config({
|
||||
meta: {
|
||||
title: 'Puzzle\'z',
|
||||
filename: 'puzzlez',
|
||||
icon: 'src/client/resources/icon.png',
|
||||
icon: 'src/icon.png',
|
||||
pack: 'ru.m.puzzlez',
|
||||
author: 'shmyga <shmyga.z@gmail.com>',
|
||||
company: 'MegaLoMania',
|
||||
|
||||
@@ -19,7 +19,7 @@ class PartView extends Sprite {
|
||||
}
|
||||
|
||||
private var size:Point;
|
||||
private var bitmap:Bitmap;
|
||||
public var bitmap:Bitmap;
|
||||
|
||||
public function new(id:Int, image:BitmapData, size:Point) {
|
||||
super();
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package ru.m.puzzlez.render;
|
||||
|
||||
import haxework.net.ImageLoader;
|
||||
import ru.m.puzzlez.core.ImageSource;
|
||||
import haxework.signal.Signal;
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.PNGEncoderOptions;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.net.FileReference;
|
||||
import flash.utils.ByteArray;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.view.SpriteView;
|
||||
import openfl.Assets;
|
||||
import ru.m.puzzlez.core.GameEvent;
|
||||
import ru.m.puzzlez.core.GameState;
|
||||
|
||||
@@ -109,10 +110,19 @@ class Render extends SpriteView implements IRender {
|
||||
signal.emit(GameEvent.PART_PUT(activePart.id, partPosition.clone()));
|
||||
table.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
||||
table.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||
//save(activePart);
|
||||
activePart = null;
|
||||
activePoint = null;
|
||||
}
|
||||
|
||||
private function save(part:PartView):Void {
|
||||
var file = new FileReference();
|
||||
var bitmapData = part.bitmap.bitmapData;
|
||||
var data = new ByteArray();
|
||||
bitmapData.encode(new Rectangle(0, 0, bitmapData.width, bitmapData.height), new PNGEncoderOptions(), data);
|
||||
file.save(data, "icon.png");
|
||||
}
|
||||
|
||||
private function clean() {
|
||||
for (partView in parts) {
|
||||
table.removeChild(partView);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package ru.m.puzzlez.view;
|
||||
|
||||
import haxework.view.form.ButtonView;
|
||||
import haxework.net.JsonLoader;
|
||||
import haxework.view.data.DataView;
|
||||
import haxework.view.group.VGroupView;
|
||||
@@ -33,12 +34,6 @@ typedef PixabayResponse = {
|
||||
images.data = [for (name in Assets.list(AssetType.IMAGE)) ASSET(name)];
|
||||
render.scale = 0.75;
|
||||
scale.position = render.scale - scale.ratio;
|
||||
|
||||
/*new JsonLoader<PixabayResponse>()
|
||||
.GET('https://pixabay.com/api/?key=14915210-5eae157281211e0ad28bc8def&category=nature')
|
||||
.then(function(result:PixabayResponse) {
|
||||
images.data = images.data.concat([for (item in result.hits) URL(item.largeImageURL)]);
|
||||
});*/
|
||||
}
|
||||
|
||||
private function imageViewFactory(index:Int, image:ImageSource):ImageView {
|
||||
@@ -50,6 +45,15 @@ typedef PixabayResponse = {
|
||||
return result;
|
||||
}
|
||||
|
||||
private function moreImages(view:ButtonView):Void {
|
||||
view.visible = false;
|
||||
new JsonLoader<PixabayResponse>()
|
||||
.GET('https://pixabay.com/api/?key=14915210-5eae157281211e0ad28bc8def&category=nature')
|
||||
.then(function(result:PixabayResponse) {
|
||||
images.data = images.data.concat([for (item in result.hits) URL(item.largeImageURL)]);
|
||||
});
|
||||
}
|
||||
|
||||
public function setScale(value:Float):Void {
|
||||
render.scale = value + scale.ratio;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@ views:
|
||||
+onDataSelect: ~start
|
||||
geometry.margin: 5
|
||||
overflow.y: scroll
|
||||
- id: more
|
||||
$type: haxework.view.form.ButtonView
|
||||
text: More
|
||||
+onPress: ~moreImages
|
||||
- id: scale
|
||||
$type: haxework.view.list.VScrollBarView
|
||||
ratio: 0.5
|
||||
|
||||
BIN
src/icon.png
Normal file
BIN
src/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Reference in New Issue
Block a user