capistrano-ash 0.0.5 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +1 -1
- data/VERSION +1 -1
- data/capistrano-ash.gemspec +1 -1
- data/lib/ash/base.rb +29 -30
- data/lib/ash/zend_doctrine.rb +19 -10
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/capistrano-ash.gemspec
CHANGED
data/lib/ash/base.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
|
-
# set default stages
|
2
|
-
set :stages, %w(staging production)
|
3
|
-
set :default_stge, "staging"
|
4
|
-
|
5
1
|
# Required gems/libraries
|
6
2
|
require 'rubygems'
|
7
3
|
require 'railsless-deploy'
|
8
|
-
require 'capistrano/ext/multistage'
|
9
4
|
require 'ash/common'
|
5
|
+
require 'capistrano/ext/multistage'
|
10
6
|
|
11
7
|
configuration = Capistrano::Configuration.respond_to?(:instance) ?
|
12
8
|
Capistrano::Configuration.instance(:must_exist) :
|
@@ -14,39 +10,42 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
|
|
14
10
|
|
15
11
|
configuration.load do
|
16
12
|
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
set :
|
25
|
-
set :
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
#
|
32
|
-
|
33
|
-
|
13
|
+
# set default stages
|
14
|
+
set :stages, %w(staging production)
|
15
|
+
set :default_stge, "staging"
|
16
|
+
|
17
|
+
# --------------------------------------------
|
18
|
+
# Setting defaults
|
19
|
+
# --------------------------------------------
|
20
|
+
set :copy_exclude, [".svn", ".DS_Store", "*.sample", "LICENSE*", "Capfile", "config", "REVISION"]
|
21
|
+
set :deploy_via, :remote_cache
|
22
|
+
set :group_writable, false
|
23
|
+
set :use_sudo, false
|
24
|
+
set :scm, :subversion
|
25
|
+
set :scm_verbose, true
|
26
|
+
|
27
|
+
# show password requests on windows (http://weblog.jamisbuck.org/2007/10/14/capistrano-2-1)
|
28
|
+
default_run_options[:pty] = true
|
29
|
+
|
30
|
+
# --------------------------------------------
|
31
|
+
# Ash methods
|
32
|
+
# --------------------------------------------
|
33
|
+
namespace :ash do
|
34
34
|
desc "Fix the permissions on Ash servers"
|
35
35
|
task :fixperms, :except => { :no_release => true } do
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
# chmod the files and directories.
|
37
|
+
run "find #{latest_release} -type d -exec chmod 755 {} \\;"
|
38
|
+
run "find #{latest_release} -type f -exec chmod 644 {} \\;"
|
39
39
|
end
|
40
40
|
|
41
41
|
desc "Task for to test that Capistrano is working"
|
42
42
|
task :uname do
|
43
|
-
|
43
|
+
run "uname -a"
|
44
44
|
end
|
45
45
|
|
46
46
|
desc "Print environment of Capistrano user"
|
47
47
|
task :getpath do
|
48
|
-
|
48
|
+
run "echo $PATH"
|
49
49
|
end
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/ash/zend_doctrine.rb
CHANGED
@@ -6,6 +6,14 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
|
|
6
6
|
Capistrano.configuration(:must_exist)
|
7
7
|
|
8
8
|
configuration.load do
|
9
|
+
# --------------------------------------------
|
10
|
+
# Set some defaults
|
11
|
+
# --------------------------------------------
|
12
|
+
# Deploy to file path
|
13
|
+
set(:deploy_to) { "/var/www/#{application}/#{stage}" }
|
14
|
+
|
15
|
+
# Define your backups directory
|
16
|
+
set(:backup_to) { "#{deploy_to}/backups/" }
|
9
17
|
|
10
18
|
# --------------------------------------------
|
11
19
|
# Calling our Methods
|
@@ -13,7 +21,6 @@ configuration.load do
|
|
13
21
|
after "deploy:setup", "deploy:setup_shared"
|
14
22
|
after "deploy:finalize_update", "ash:fixperms"
|
15
23
|
after "deploy:symlink", "zend:symlink"
|
16
|
-
after "zend:symlink", "zend:set_environment"
|
17
24
|
after "deploy", "deploy:cleanup"
|
18
25
|
|
19
26
|
# --------------------------------------------
|
@@ -43,15 +50,17 @@ configuration.load do
|
|
43
50
|
task :symlink, :except => { :no_release => true } do
|
44
51
|
run "ln -nfs #{shared_path}/var #{current_release}/var"
|
45
52
|
run "ln -nfs #{shared_path}/system #{current_release}/public/system"
|
46
|
-
run "mv #{
|
47
|
-
run "
|
48
|
-
run "
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
53
|
+
run "mv #{current_release}/application/configs/application.ini.dist #{current_release}/application/configs/application.ini"
|
54
|
+
run "ln -nfs #{current_release}/application/Application.#{stage}.php #{current_release}/application/Application.php"
|
55
|
+
run "mv #{current_release}/public/htaccess.#{stage} #{current_release}/public/.htaccess"
|
56
|
+
run "cp #{current_release}/scripts/doctrine-cli.#{stage} #{current_release}/scripts/doctrine-cli"
|
57
|
+
sudo "chmod +x #{current_release}/scripts/doctrine-cli"
|
58
|
+
|
59
|
+
# remove the example or other environment example files
|
60
|
+
run "rm -f #{current_release}/scripts/doctrine-cli.dist"
|
61
|
+
run "rm -f #{current_release}/scripts/doctrine-cli.staging"
|
62
|
+
run "rm -f #{current_release}/scripts/doctrine-cli.production"
|
63
|
+
run "rm -f #{current_release}/application/Application.example.php"
|
55
64
|
end
|
56
65
|
end
|
57
66
|
|