@@ -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
@@ -221,6 +229,7 @@ namespace :typo3 do
221229
222230 desc 'Remove not needed extensions'
223231 task :remove_extensions do
232+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
224233 installed_extensions = ( capture_typo3_console_in_loop 1 , 'extension:list' , '--active' , '--raw' ) . split ( "\n " )
225234
226235 run_locally do
@@ -232,13 +241,13 @@ namespace :typo3 do
232241
233242 on roles :app do
234243 # Get extensions from typo3conf/ext directory
235- 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
236245
237246 extensions_to_remove = ( remote_list - installed_extensions )
238247 unless extensions_to_remove . empty?
239248 info I18n . t ( 'tasks.typo3.cms.v6.remove_extensions.info' , scope : :dkdeploy , removed_extensions : extensions_to_remove . join ( ', ' ) )
240249 extensions_to_remove . each do |extension |
241- execute :rm , '-rf' , " #{ release_path } / typo3conf/ext/ #{ extension } "
250+ execute :rm , '-rf' , File . join ( release_path , remote_web_root_path , ' typo3conf/ext' , extension )
242251 end
243252 end
244253 end
@@ -260,8 +269,9 @@ namespace :typo3 do
260269
261270 desc 'Sets up the TYPO3 6+ specific configuration for each stage'
262271 task :setup_additional_configuration , :additional_configuration_template do |_ , args |
272+ remote_web_root_path = fetch ( :remote_web_root_path , '.' )
263273 configuration_template = ask_variable ( args , :additional_configuration_template , 'questions.additional_configuration_template' )
264- 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' )
265275 unless File . exist? ( configuration_template )
266276 run_locally do
267277 raise I18n . t ( 'tasks.typo3.cms.v6.setup_additional_configuration.upload_info' , configuration_template : configuration_template , scope : :dkdeploy )
0 commit comments