kstrano 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/bin/kumafy CHANGED
@@ -23,6 +23,9 @@ RECIPES = {
23
23
  },
24
24
  "magento" => {
25
25
  "config_path" => "app/config"
26
+ },
27
+ "silex" => {
28
+ "config_path" => "."
26
29
  }
27
30
  } # all the supported recipes
28
31
 
@@ -302,4 +305,4 @@ rescue NoMethodError => e
302
305
  # Do nothing
303
306
  end
304
307
 
305
- puts "[done] project kumafied!"
308
+ puts "[done] project kumafied!"
data/lib/kstrano_play.rb CHANGED
@@ -8,6 +8,8 @@ module KStrano
8
8
  load_paths.push File.expand_path('../', __FILE__)
9
9
  load 'kstrano'
10
10
 
11
+ set :play_version, "2.2.0"
12
+
11
13
  namespace :deploy do
12
14
  desc "Updates latest release source path"
13
15
  task :finalize_update, :roles => :app, :except => { :no_release => true } do
@@ -24,7 +26,14 @@ module KStrano
24
26
  namespace :play do
25
27
  desc "Build the app"
26
28
  task :package do
27
- try_sudo "bash -c 'PATH=$PATH:/home/projects/#{application}/play/default:. && cd #{latest_release} && play clean compile stage'"
29
+ unless File.directory?("/home/projects/#{application}/play/play-#{play_version}")
30
+ try_sudo "bash -ic 'cd /home/projects/#{application}/play &&
31
+ wget http://downloads.typesafe.com/play/#{play_version}/play-#{play_version}.zip &&
32
+ unzip play-#{play_version}.zip &&
33
+ rm play-#{play_version}.zip &&
34
+ chmod -R 775 play-#{play_version}'"
35
+ end
36
+ try_sudo "bash -c 'cd #{latest_release} && /home/projects/#{application}/play/play-#{play_version}/play clean compile stage'"
28
37
  end
29
38
 
30
39
  desc "Start the server"
@@ -47,4 +56,4 @@ end
47
56
 
48
57
  if Capistrano::Configuration.instance
49
58
  KStrano::Play.load_into(Capistrano::Configuration.instance)
50
- end
59
+ end
@@ -0,0 +1,97 @@
1
+ require 'railsless-deploy'
2
+ require 'capifony_symfony2'
3
+ require "#{File.dirname(__FILE__)}/helpers/kuma_helper.rb"
4
+
5
+ module KStrano
6
+ module Silex
7
+ def self.load_into(configuration)
8
+ configuration.load do
9
+
10
+ load_paths.push File.expand_path('../', __FILE__)
11
+ load 'kstrano'
12
+
13
+ set :php_bin, "php"
14
+ set :copy_vendors, true
15
+ set :interactive_mode, false
16
+ set :cache_warmup, false
17
+ set :use_composer, true
18
+ set :update_vendors, false
19
+
20
+ namespace :kuma do
21
+
22
+ namespace :fpm do
23
+ desc "Reload PHP5 fpm"
24
+ task :reload do
25
+ sudo "/etc/init.d/php5-fpm reload"
26
+ end
27
+
28
+ desc "Restart PHP5 fpm"
29
+ task :restart do
30
+ sudo "/etc/init.d/php5-fpm restart"
31
+ end
32
+
33
+ desc "Gracefully restart PHP5 fpm"
34
+ task :graceful_restart do
35
+ sudo "pkill -QUIT -f \"^php-fpm: pool #{application} \" "
36
+ end
37
+ end
38
+
39
+ namespace :apc do
40
+ desc "Prepare for APC cache clear"
41
+ task :prepare_clear do
42
+ server_project_name = "#{server_name}"
43
+ if server_project_name.nil? || server_project_name.empty?
44
+ server_project_name = domain.split('.')[0]
45
+ end
46
+ sudo "sh -c 'if [ ! -f /home/projects/#{server_project_name}/site/apcclear.php ]; then curl https://raw.github.com/Kunstmaan/kStrano/master/resources/symfony2/apcclear.php > /home/projects/#{server_project_name}/site/apcclear.php; fi'"
47
+ sudo "chmod 777 /home/projects/#{server_project_name}/site/apcclear.php"
48
+ end
49
+
50
+ desc "Clear the APC cache"
51
+ task :clear do
52
+ hostname = "#{domain}"
53
+ server_project_name = "#{server_name}"
54
+ if !server_project_name.nil? && !server_project_name.empty?
55
+ hostname = "#{server_project_name}.#{hostname}"
56
+ end
57
+ sudo "curl http://#{hostname}/apcclear.php"
58
+ end
59
+ end
60
+ end
61
+
62
+ namespace :deploy do
63
+
64
+ desc "Deploy without copying the vendors from a previous install"
65
+ task :clean, :roles => :app, :except => {:no_release => true} do
66
+ set :copy_vendors, false
67
+ deploy.update
68
+ deploy.restart
69
+ end
70
+
71
+ namespace :prefer do
72
+ desc "Deploy without copying the vendors from a previous install and use composer option --prefer-source"
73
+ task :source, :roles => :app, :except => {:no_release => true} do
74
+ set :composer_options, "--no-dev --no-scripts --verbose --prefer-source --optimize-autoloader"
75
+ deploy.clean
76
+ end
77
+
78
+ end
79
+ end
80
+
81
+ # set the right permissions on the vendor folder ...
82
+ after "symfony:composer:copy_vendors" do
83
+ sudo "sh -c 'if [ -d #{latest_release}/vendor ] ; then chown -R #{application}:#{application} #{latest_release}/vendor; fi'"
84
+ end
85
+
86
+ before "deploy:finalize_update", "kuma:apc:prepare_clear"
87
+ after "deploy:finalize_update", "kuma:apc:clear", "kuma:fpm:graceful_restart"
88
+ after "deploy:create_symlink", "kuma:apc:clear", "kuma:fpm:graceful_restart"
89
+
90
+ end
91
+ end
92
+ end
93
+ end
94
+
95
+ if Capistrano::Configuration.instance
96
+ KStrano::Silex.load_into(Capistrano::Configuration.instance)
97
+ end
@@ -1,2 +1,3 @@
1
1
  set :writable_dirs, ["logs", "pids"]
2
- set :shared_children, ["logs", "pids"]
2
+ set :shared_children, ["logs", "pids"]
3
+ set :play_version, "2.2.0"
@@ -14,4 +14,6 @@ set :grunt_build, true
14
14
 
15
15
  # When using Symfony 2.1
16
16
  set :use_composer, true
17
- set :update_vendors, false
17
+ set :update_vendors, false
18
+
19
+ set :update_assets_version, true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kstrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
12
+ date: 2013-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capifony
@@ -123,6 +123,7 @@ files:
123
123
  - lib/kstrano_drupal.rb
124
124
  - lib/kstrano_magento.rb
125
125
  - lib/kstrano_play.rb
126
+ - lib/kstrano_silex.rb
126
127
  - lib/kstrano_symfony2.rb
127
128
  - resources/deploy.rb
128
129
  - resources/deploy_production.rb