[add] ansible deploy
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
build/
|
/build/
|
||||||
target/
|
target/
|
||||||
src-gen/
|
src-gen/
|
||||||
out/
|
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: {
|
meta: {
|
||||||
title: 'Puzzle\'z',
|
title: 'Puzzle\'z',
|
||||||
filename: 'puzzlez',
|
filename: 'puzzlez',
|
||||||
icon: 'src/client/resources/icon.png',
|
icon: 'src/icon.png',
|
||||||
pack: 'ru.m.puzzlez',
|
pack: 'ru.m.puzzlez',
|
||||||
author: 'shmyga <shmyga.z@gmail.com>',
|
author: 'shmyga <shmyga.z@gmail.com>',
|
||||||
company: 'MegaLoMania',
|
company: 'MegaLoMania',
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class PartView extends Sprite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var size:Point;
|
private var size:Point;
|
||||||
private var bitmap:Bitmap;
|
public var bitmap:Bitmap;
|
||||||
|
|
||||||
public function new(id:Int, image:BitmapData, size:Point) {
|
public function new(id:Int, image:BitmapData, size:Point) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
package ru.m.puzzlez.render;
|
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.BitmapData;
|
||||||
|
import flash.display.PNGEncoderOptions;
|
||||||
import flash.display.Sprite;
|
import flash.display.Sprite;
|
||||||
import flash.events.MouseEvent;
|
import flash.events.MouseEvent;
|
||||||
import flash.geom.Point;
|
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 haxework.view.SpriteView;
|
||||||
import openfl.Assets;
|
|
||||||
import ru.m.puzzlez.core.GameEvent;
|
import ru.m.puzzlez.core.GameEvent;
|
||||||
import ru.m.puzzlez.core.GameState;
|
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()));
|
signal.emit(GameEvent.PART_PUT(activePart.id, partPosition.clone()));
|
||||||
table.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
table.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
|
||||||
table.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
table.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
|
||||||
|
//save(activePart);
|
||||||
activePart = null;
|
activePart = null;
|
||||||
activePoint = 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() {
|
private function clean() {
|
||||||
for (partView in parts) {
|
for (partView in parts) {
|
||||||
table.removeChild(partView);
|
table.removeChild(partView);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package ru.m.puzzlez.view;
|
package ru.m.puzzlez.view;
|
||||||
|
|
||||||
|
import haxework.view.form.ButtonView;
|
||||||
import haxework.net.JsonLoader;
|
import haxework.net.JsonLoader;
|
||||||
import haxework.view.data.DataView;
|
import haxework.view.data.DataView;
|
||||||
import haxework.view.group.VGroupView;
|
import haxework.view.group.VGroupView;
|
||||||
@@ -33,12 +34,6 @@ typedef PixabayResponse = {
|
|||||||
images.data = [for (name in Assets.list(AssetType.IMAGE)) ASSET(name)];
|
images.data = [for (name in Assets.list(AssetType.IMAGE)) ASSET(name)];
|
||||||
render.scale = 0.75;
|
render.scale = 0.75;
|
||||||
scale.position = render.scale - scale.ratio;
|
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 {
|
private function imageViewFactory(index:Int, image:ImageSource):ImageView {
|
||||||
@@ -50,6 +45,15 @@ typedef PixabayResponse = {
|
|||||||
return result;
|
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 {
|
public function setScale(value:Float):Void {
|
||||||
render.scale = value + scale.ratio;
|
render.scale = value + scale.ratio;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ views:
|
|||||||
+onDataSelect: ~start
|
+onDataSelect: ~start
|
||||||
geometry.margin: 5
|
geometry.margin: 5
|
||||||
overflow.y: scroll
|
overflow.y: scroll
|
||||||
|
- id: more
|
||||||
|
$type: haxework.view.form.ButtonView
|
||||||
|
text: More
|
||||||
|
+onPress: ~moreImages
|
||||||
- id: scale
|
- id: scale
|
||||||
$type: haxework.view.list.VScrollBarView
|
$type: haxework.view.list.VScrollBarView
|
||||||
ratio: 0.5
|
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