capistrano-typo3 0.4.3 → 0.4.4
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.
- checksums.yaml +4 -4
- data/lib/capistrano/tasks/typo3.cap +92 -0
- data/lib/capistrano/typo3/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0a4369ce85fbce3be331a12599bb3681335d6d
|
4
|
+
data.tar.gz: c6c58ab9269b249fff83f1abe7a504426c2411e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ce2082d925d0fc9b1aed2251ac750af5ffe91f177bd71feec3e89a1d87ea86a53cae0554bf5ac82605ac947d8ebfa97194dbaf7965da2c8e9c3e0859cf8cbb7
|
7
|
+
data.tar.gz: 7c413971313c8b60cc1f8b416d87795240ffba85650ca05bf9c41e6a6dce434b209978240472b9591a51e8469d46a71911c8d17ab95b560dd0e83880f893fa0f
|
@@ -105,6 +105,74 @@ namespace :typo3 do
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
+
desc 'sync database from production to a local mysql'
|
109
|
+
task :sync_db_from_production_local_no_pass do
|
110
|
+
|
111
|
+
ignorestring = ""
|
112
|
+
|
113
|
+
if(:t3_db_sync_ignore_tables)
|
114
|
+
|
115
|
+
fetch(:t3_db_sync_ignore_tables).each do | ignore_tbl |
|
116
|
+
ignorestring = "#{ignorestring} --ignore-table=#{fetch(:t3_live_sync)['dbsync']['dbname']}.#{ignore_tbl}"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# DUMP DATABASE TO IMAGE
|
121
|
+
system <<DBSYNC1
|
122
|
+
ssh #{fetch(:t3_live_sync)['dbsync']['ssh_user']}@#{fetch(:t3_live_sync)['dbsync']['ssh_server']} \
|
123
|
+
'mysqldump -u#{fetch(:t3_live_sync)['dbsync']['dbuser']} \
|
124
|
+
-h#{fetch(:t3_live_sync)['dbsync']['dbhost']} \
|
125
|
+
-p#{fetch(:t3_live_sync)['dbsync']['dbpass']} \
|
126
|
+
#{ignorestring} \
|
127
|
+
#{fetch(:t3_live_sync)['dbsync']['dbname']} > /tmp/.captypo3dump-src-#{fetch(:t3_live_sync)['dbsync']['dbname']}'
|
128
|
+
DBSYNC1
|
129
|
+
|
130
|
+
if(:t3_db_sync_ignore_tables)
|
131
|
+
fetch(:t3_db_sync_ignore_tables).each do | ignore_tbl |
|
132
|
+
|
133
|
+
system <<DBSYNC1
|
134
|
+
ssh #{fetch(:t3_live_sync)['dbsync']['ssh_user']}@#{fetch(:t3_live_sync)['dbsync']['ssh_server']} \
|
135
|
+
'mysqldump -u#{fetch(:t3_live_sync)['dbsync']['dbuser']} \
|
136
|
+
-h#{fetch(:t3_live_sync)['dbsync']['dbhost']} \
|
137
|
+
-p#{fetch(:t3_live_sync)['dbsync']['dbpass']} \
|
138
|
+
--no-data \
|
139
|
+
#{fetch(:t3_live_sync)['dbsync']['dbname']} #{ignore_tbl} >> /tmp/.captypo3dump-src-#{fetch(:t3_live_sync)['dbsync']['dbname']}'
|
140
|
+
DBSYNC1
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# COMPRESS IMAGE
|
145
|
+
system <<DBSYNC2
|
146
|
+
ssh #{fetch(:t3_live_sync)['dbsync']['ssh_user']}@#{fetch(:t3_live_sync)['dbsync']['ssh_server']} \
|
147
|
+
'gzip -f /tmp/.captypo3dump-src-#{fetch(:t3_live_sync)['dbsync']['dbname']}'
|
148
|
+
DBSYNC2
|
149
|
+
|
150
|
+
# TRANSFER IMAGE
|
151
|
+
system <<DBSYNC3
|
152
|
+
scp #{fetch(:t3_live_sync)['dbsync']['ssh_user']}@#{fetch(:t3_live_sync)['dbsync']['ssh_server']}:/tmp/.captypo3dump-src-#{fetch(:t3_live_sync)['dbsync']['dbname']}.gz \
|
153
|
+
/tmp/.captypo3dump-dest-#{fetch(:t3_live_sync)['dbsync']['dbname']}.gz
|
154
|
+
DBSYNC3
|
155
|
+
|
156
|
+
# DECOMPRESS IMAGE
|
157
|
+
system <<DBSYNC4
|
158
|
+
gunzip -f /tmp/.captypo3dump-dest-#{fetch(:t3_live_sync)['dbsync']['dbname']}.gz
|
159
|
+
DBSYNC4
|
160
|
+
|
161
|
+
# IMPORT AND REMOVE IMAGE
|
162
|
+
system <<DBSYNC5
|
163
|
+
mysql -u#{fetch(:dbuser)} -h#{fetch(:dbhost)} #{fetch(:dbname)} < /tmp/.captypo3dump-dest-#{fetch(:t3_live_sync)['dbsync']['dbname']} && \
|
164
|
+
rm -f /tmp/.captypo3dump-dest-#{fetch(:t3_live_sync)['dbsync']['dbname']}
|
165
|
+
DBSYNC5
|
166
|
+
|
167
|
+
# REMOVE IMAGE
|
168
|
+
system <<DBSYNC6
|
169
|
+
ssh #{fetch(:t3_live_sync)['dbsync']['ssh_user']}@#{fetch(:t3_live_sync)['dbsync']['ssh_server']} \
|
170
|
+
'rm -f /tmp/.captypo3dump-src-#{fetch(:t3_live_sync)['dbsync']['dbname']}.gz'
|
171
|
+
DBSYNC6
|
172
|
+
|
173
|
+
end
|
174
|
+
|
175
|
+
|
108
176
|
desc 'sync database from production and run sql updates'
|
109
177
|
task :sync_db_from_production do
|
110
178
|
on roles(:allow_syncdatabase) do
|
@@ -447,6 +515,30 @@ deprecation_*.log
|
|
447
515
|
end
|
448
516
|
end
|
449
517
|
|
518
|
+
desc "update LocalConf with correct db credentionals without SSH"
|
519
|
+
task :update_localconf_local do
|
520
|
+
|
521
|
+
system "echo '<?php' > dummy/typo3conf/AdditionalConfiguration.php"
|
522
|
+
|
523
|
+
if fetch(:t3_add_unsafe_trusted_host_pattern)
|
524
|
+
system "echo ' $GLOBALS[\"TYPO3_CONF_VARS\"][\"SYS\"][\"trustedHostsPattern\"] = \".*\";' >> dummy/typo3conf/AdditionalConfiguration.php"
|
525
|
+
end
|
526
|
+
|
527
|
+
if fetch(:t3_store_db_credentials_in_addionalconf)
|
528
|
+
system "echo ' $GLOBALS[\"TYPO3_CONF_VARS\"][\"DB\"][\"database\"] = \"#{fetch(:dbname)}\";' >> dummy/typo3conf/AdditionalConfiguration.php"
|
529
|
+
system "echo ' $GLOBALS[\"TYPO3_CONF_VARS\"][\"DB\"][\"host\"] = \"#{fetch(:dbhost)}\";' >> dummy/typo3conf/AdditionalConfiguration.php"
|
530
|
+
system "echo ' $GLOBALS[\"TYPO3_CONF_VARS\"][\"DB\"][\"password\"] = \"#{fetch(:dbpass)}\";' >> dummy/typo3conf/AdditionalConfiguration.php"
|
531
|
+
system "echo ' $GLOBALS[\"TYPO3_CONF_VARS\"][\"DB\"][\"username\"] = \"#{fetch(:dbuser)}\";' >> dummy/typo3conf/AdditionalConfiguration.php"
|
532
|
+
else
|
533
|
+
cmd1 =Typo3Helper::make_set_localconf_database_settings_command(fetch(:dbname),fetch(:dbuser),fetch(:dbpass),fetch(:dbhost))
|
534
|
+
system "cd #{fetch(:deploy_to)} && #{cmd1}"
|
535
|
+
|
536
|
+
cmd2 = "mv #{fetch(:typo3_v6_local_conf_path)}.tmp #{fetch(:typo3_v6_local_conf_path)}"
|
537
|
+
system "cd #{fetch(:deploy_to)} && #{cmd2}"
|
538
|
+
end
|
539
|
+
end
|
540
|
+
|
541
|
+
|
450
542
|
desc "update LocalConf with correct db credentionals"
|
451
543
|
task :update_localconf do
|
452
544
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-typo3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pim Snel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03
|
11
|
+
date: 2018-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.6.14
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Capistrano 3 tasks and CI for TYPO3
|