erCapistranoDrupal 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -2
- data/lib/erCapistranoDrupal/version.rb +1 -1
- data/lib/erCapistranoDrupal.rb +17 -14
- metadata +4 -4
data/README.md
CHANGED
@@ -10,7 +10,7 @@ erCapistranoDrupal is a drupal deploy file for Capistrano. Includes site install
|
|
10
10
|
|
11
11
|
## Versions
|
12
12
|
* Drupal 7
|
13
|
-
* Drupal 6
|
13
|
+
* Drupal 6
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -52,7 +52,7 @@ You should then be able to proceed as you would usually, you may want to familia
|
|
52
52
|
|
53
53
|
#### Drush File
|
54
54
|
# create new user 'everright'
|
55
|
-
user-create everright --mail=
|
55
|
+
user-create everright --mail=everright@example.com --password=123456
|
56
56
|
# enable token module
|
57
57
|
en token
|
58
58
|
|
@@ -79,6 +79,9 @@ You should then be able to proceed as you would usually, you may want to familia
|
|
79
79
|
### Drush tool
|
80
80
|
* :drush, '/usr/bin/drush'
|
81
81
|
|
82
|
+
### Drupal version, 6 or 7
|
83
|
+
* :dp_version, 7
|
84
|
+
|
82
85
|
### Drush site install info
|
83
86
|
If you want to install the drupal when first deploy, then you need to change these variables.
|
84
87
|
* :dp_site_install, false
|
@@ -174,6 +177,11 @@ System will be auto set the maintainance key to "site_readonly" when "Read Only
|
|
174
177
|
|
175
178
|
## Changelog:
|
176
179
|
|
180
|
+
### Version 0.1.2 - June 28 2013
|
181
|
+
* Add drupal 6 support
|
182
|
+
* Fix release files backup bug
|
183
|
+
* Fix database migration bug on migration was not exist
|
184
|
+
|
177
185
|
### Version 0.1.1 - June 19 2013
|
178
186
|
* Fix muiltiple servers deploy bug
|
179
187
|
* Fix rollback permissions bug
|
data/lib/erCapistranoDrupal.rb
CHANGED
@@ -89,11 +89,14 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
89
89
|
# Drush tool
|
90
90
|
_cset :drush, '/usr/bin/drush'
|
91
91
|
|
92
|
+
# Drupal version, 6 or 7
|
93
|
+
_cset :dp_version, 7
|
94
|
+
|
92
95
|
# Drush site install info
|
93
96
|
_cset :dp_site_install, false
|
94
97
|
_cset :dp_site_db_url, nil
|
95
|
-
_cset
|
96
|
-
_cset
|
98
|
+
_cset(:dp_site_profile) { dp_version == 6 ? 'default' : 'standard' }
|
99
|
+
_cset(:dp_site_name) { dp_version == 6 ? 'Drupal 6 Demo' : 'Drupal 7 Demo' }
|
97
100
|
_cset :dp_site_admin_user, 'admin'
|
98
101
|
_cset :dp_site_admin_pass, 'admin'
|
99
102
|
|
@@ -101,7 +104,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
101
104
|
# If "Read Only Mode" enabled, then set maintainance key to 'site_readonly'
|
102
105
|
# else set maintainance key to 'maintenance_mode'
|
103
106
|
# =========================================================================
|
104
|
-
_cset
|
107
|
+
_cset(:dp_maintainance_keys) { dp_version == 6 ? {'default' => 'site_offline'} : {'default' => 'maintenance_mode'}}
|
105
108
|
|
106
109
|
# =========================================================================
|
107
110
|
# These are helper methods that will be available to your recipes.
|
@@ -647,17 +650,19 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
647
650
|
# Append hook_update migration
|
648
651
|
commands << "#{drush} updb --root=#{current_path} --uri=#{domain} -y"
|
649
652
|
|
653
|
+
migration_commands = []
|
650
654
|
# Append drush migration
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
+
migration_commands << "#{try_sudo} touch #{drush_history}"
|
656
|
+
migration_commands << "find #{current_path}/#{dp_migration}/#{domain} -type f -name *.drush | xargs ls -1v 2>/dev/null > #{drush_available}"
|
657
|
+
migration_commands << "diff #{drush_available} #{drush_history} | awk \"/^</ {print \\$2}\" | while read f; do echo \"Migrating: $(basename $f)\"; egrep -v \"^$|^#|^[[:space:]]+$\" $f | while read line; do echo \"Running: drush $line\"; #{drush} $line --root=#{current_path} --uri=#{domain} -y; done; echo $f >> #{drush_history}; done"
|
658
|
+
migration_commands << "#{try_sudo} rm -f #{drush_available}"
|
655
659
|
|
656
660
|
# Append sql migration
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
+
migration_commands << "#{try_sudo} touch #{sql_history}"
|
662
|
+
migration_commands << "find #{current_path}/#{dp_migration}/#{domain} -type f -name *.sql | xargs ls -1v 2>/dev/null > #{sql_available}"
|
663
|
+
migration_commands << "diff #{sql_available} #{sql_history} | awk \"/^</ {print \\$2}\" | while read f; do echo \"Migrating $(basename $f)\"; #{drush} -r #{current_path} --uri=#{domain} sqlq --file=$f -y && echo $f >> #{sql_history}; done"
|
664
|
+
migration_commands << "#{try_sudo} rm -f #{sql_available}"
|
665
|
+
commands << "if [ -d #{current_path}/#{dp_migration}/#{domain} ]; then #{migration_commands.join('; ')}; fi"
|
661
666
|
end
|
662
667
|
|
663
668
|
run commands.join('; ') if commands.any?
|
@@ -690,9 +695,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
690
695
|
commands = []
|
691
696
|
|
692
697
|
dp_domains.each do |domain|
|
693
|
-
commands << "cd #{shared_path}/#{dp_sites}/#{domain}"
|
694
|
-
commands << "#{try_sudo} tar cjf #{shared_path}/#{dp_released_files}/#{domain}/#{domain}_files_#{release_name}.tar.bz2 files"
|
695
|
-
commands << "cd -"
|
698
|
+
commands << "cd #{shared_path}/#{dp_sites}/#{domain} && #{try_sudo} tar cjf #{shared_path}/#{dp_released_files}/#{domain}/#{domain}_files_#{release_name}.tar.bz2 files && cd -"
|
696
699
|
end
|
697
700
|
|
698
701
|
run commands.join('; ') if commands.any?
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erCapistranoDrupal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- everright.chen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-06-
|
18
|
+
date: 2013-06-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: capistrano
|