@@ -20,15 +20,18 @@ namespace :typo3 do
2020 namespace :cms do
2121 desc 'Clear typo3temp directory'
2222 task :clear_typo3temp do
23+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
24+
2325 on release_roles :app do
2426 info I18n . t ( 'tasks.clear_temp.clear' , scope : :dkdeploy )
25- execute :rm , '-rf' , File . join ( release_path , 'typo3temp' , '*' )
27+ execute :rm , '-rf' , File . join ( release_path , remote_web_root_path , 'typo3temp' , '*' )
2628 end
2729 end
2830
2931 desc 'Disable TYPO3 install tool'
3032 task :disable_install_tool do
31- flag = File . join ( current_path , 'typo3conf' , 'ENABLE_INSTALL_TOOL' )
33+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
34+ flag = File . join ( current_path , remote_web_root_path , 'typo3conf' , 'ENABLE_INSTALL_TOOL' )
3235
3336 on release_roles :app do
3437 if test "[ -f #{ flag } ]"
@@ -40,10 +43,12 @@ namespace :typo3 do
4043
4144 desc 'Enable TYPO3 install tool'
4245 task :enable_install_tool do
46+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
47+
4348 on release_roles :app do
4449 info I18n . t ( 'tasks.install_tool.enable' , scope : :dkdeploy )
45- execute :mkdir , '-p' , File . join ( current_path , 'typo3conf' )
46- execute :touch , File . join ( current_path , 'typo3conf' , 'ENABLE_INSTALL_TOOL' )
50+ execute :mkdir , '-p' , File . join ( current_path , remote_web_root_path , 'typo3conf' )
51+ execute :touch , File . join ( current_path , remote_web_root_path , 'typo3conf' , 'ENABLE_INSTALL_TOOL' )
4752 end
4853 end
4954
@@ -78,14 +83,17 @@ namespace :typo3 do
7883
7984 desc 'Download extension to local workspace'
8085 task :fetch_extension , :extension do |_ , args |
81- extension = ask_variable ( args , :extension , 'tasks.fetch_extension.extension_name' )
86+ local_web_root_path = ask_array_variable ( args , :local_web_root_path , 'questions.local_web_root_path' )
87+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
88+ extension = ask_variable ( args , :extension , 'tasks.fetch_extension.extension_name' )
89+
8290 FileUtils . mkdir_p File . join ( 'temp' , 'extensions' )
8391 FileUtils . remove_dir File . join ( 'temp' , 'extensions' , extension ) , true
84- source = File . join ( current_path , 'typo3conf' , 'ext' , extension )
92+ source = File . join ( current_path , remote_web_root_path , 'typo3conf' , 'ext' , extension )
8593 target = File . join ( 'temp' , 'extensions' )
8694
8795 on primary ( :backend ) do
88- if test "[ -d #{ File . join ( current_path , 'typo3conf' , 'ext' , extension ) } ]"
96+ if test "[ -d #{ File . join ( current_path , remote_web_root_path , 'typo3conf' , 'ext' , extension ) } ]"
8997 # download to temp
9098 info I18n . t ( 'tasks.fetch_extension.download' , extension : extension , scope : :dkdeploy )
9199 download! source , target , via : :scp , recursive : true
@@ -103,7 +111,7 @@ namespace :typo3 do
103111 rsync_exclude_directories . each do |exclude |
104112 rsync_excludes << '--exclude=' + exclude
105113 end
106- execute :rsync , '-vrS' , '--force' , '-C' , '--delete' , rsync_excludes , File . join ( 'temp' , 'extensions' , extension , '/' ) , File . join ( 'htdocs' , 'typo3conf' , 'ext' , extension , '/' )
114+ execute :rsync , '-vrS' , '--force' , '-C' , '--delete' , rsync_excludes , File . join ( 'temp' , 'extensions' , extension , '/' ) , File . join ( local_web_root_path , 'typo3conf' , 'ext' , extension , '/' )
107115 end
108116 end
109117
@@ -208,11 +216,10 @@ namespace :typo3 do
208216 end
209217 end
210218
211- # Deactivate Task. Wait for https://github.com/TYPO3-Console/typo3_console/pull/288
212- # desc 'add_static_db_content'
213- # task :add_static_db_content do
214- # typo3_console 'database:importstaticdata'
215- # end
219+ desc 'Task to import static extension data into TYPO3'
220+ task :setup_active_extensions do
221+ typo3_console 'extension:setupactive' , '--verbose'
222+ end
216223
217224 desc 'Update translations for core and extensions (l10n)'
218225 task :update_translations , :typo3_languages_to_translate do |_ , args |
@@ -222,6 +229,7 @@ namespace :typo3 do
222229
223230 desc 'Remove not needed extensions'
224231 task :remove_extensions do
232+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
225233 installed_extensions = ( capture_typo3_console_in_loop 1 , 'extension:list' , '--active' , '--raw' ) . split ( "\n " )
226234
227235 run_locally do
@@ -233,13 +241,13 @@ namespace :typo3 do
233241
234242 on roles :app do
235243 # Get extensions from typo3conf/ext directory
236- remote_list = capture ( :ls , '-x' , File . join ( current_path , 'typo3conf' , 'ext' ) ) . split
244+ remote_list = capture ( :ls , '-x' , File . join ( current_path , remote_web_root_path , 'typo3conf' , 'ext' ) ) . split
237245
238246 extensions_to_remove = ( remote_list - installed_extensions )
239247 unless extensions_to_remove . empty?
240248 info I18n . t ( 'tasks.typo3.cms.v6.remove_extensions.info' , scope : :dkdeploy , removed_extensions : extensions_to_remove . join ( ', ' ) )
241249 extensions_to_remove . each do |extension |
242- execute :rm , '-rf' , " #{ release_path } / typo3conf/ext/ #{ extension } "
250+ execute :rm , '-rf' , File . join ( release_path , remote_web_root_path , ' typo3conf/ext' , extension )
243251 end
244252 end
245253 end
@@ -261,8 +269,9 @@ namespace :typo3 do
261269
262270 desc 'Sets up the TYPO3 6+ specific configuration for each stage'
263271 task :setup_additional_configuration , :additional_configuration_template do |_ , args |
272+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
264273 configuration_template = ask_variable ( args , :additional_configuration_template , 'questions.additional_configuration_template' )
265- remote_configuration_file = File . join ( release_path , 'typo3conf' , 'AdditionalConfiguration.php' )
274+ remote_configuration_file = File . join ( release_path , remote_web_root_path , 'typo3conf' , 'AdditionalConfiguration.php' )
266275 unless File . exist? ( configuration_template )
267276 run_locally do
268277 raise I18n . t ( 'tasks.typo3.cms.v6.setup_additional_configuration.upload_info' , configuration_template : configuration_template , scope : :dkdeploy )
0 commit comments