[deploy] update
This commit is contained in:
@@ -1,44 +1,27 @@
|
||||
require_relative 'service'
|
||||
require_relative 'npm'
|
||||
|
||||
app = 'tankz'
|
||||
user = 'holop'
|
||||
|
||||
set :scm, :git
|
||||
# git
|
||||
set :application, app
|
||||
set :repo_url, "git@bitbucket.org:shmyga/#{app}.git"
|
||||
set :user, user
|
||||
set :deploy_to, "/home/#{user}/repo/#{app}"
|
||||
|
||||
# airbrussh
|
||||
set :format, :airbrussh
|
||||
set :format_options, command_output: false
|
||||
|
||||
namespace :build do
|
||||
task :lib do
|
||||
on roles(:app) do
|
||||
execute "mkdir ~/haxelib 2>/dev/null || :"
|
||||
execute "haxelib setup ~/haxelib"
|
||||
execute "haxelib install lime"
|
||||
execute "haxelib install openfl"
|
||||
execute "haxelib install protohx"
|
||||
execute "haxelib install orm"
|
||||
execute "haxelib git haxework git@bitbucket.org:shmyga/haxework.git"
|
||||
end
|
||||
end
|
||||
# npm
|
||||
set :npm_target_path, -> { "/home/#{fetch(:user)}/npm" }
|
||||
set :npm_flags, '--silent --no-spin'
|
||||
set :npm_roles, :web
|
||||
set :npm_env_variables, {}
|
||||
|
||||
task :gen do
|
||||
on roles(:app) do
|
||||
execute "cd #{release_path} && haxelib run protohx generate protohx.json"
|
||||
execute "cd #{release_path} && haxelib run orm mysql://shmyga:xkbp8jh9z2@localhost:3306/armageddon -s src-gen/haxe -c ru.m.tankz.db -a ru.m.tankz.db"
|
||||
end
|
||||
end
|
||||
|
||||
task :run do
|
||||
on roles(:app) do
|
||||
execute "cd #{release_path} && openfl build html5"
|
||||
execute "cd #{release_path} && openfl build flash"
|
||||
execute "cd #{release_path} && haxe server.hxml"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# before 'build:run', 'build:lib'
|
||||
# before 'build:run', 'build:gen'
|
||||
# before 'deploy:updated', 'build:run'
|
||||
# gulp
|
||||
set :gulp_target_path, -> { release_path }
|
||||
set :gulp_tasks, 'client'
|
||||
set :gulp_flags, '--no-color'
|
||||
set :gulp_roles, :web
|
||||
# before 'deploy:updated', 'gulp'
|
||||
|
||||
Reference in New Issue
Block a user