Commit ef662e77 authored by Stefan Galinski's avatar Stefan Galinski 🎮
Browse files

[TASK] Improve resource copy handling

parent 31625a9b
......@@ -62,31 +62,28 @@ action :add do
timeout 3000000
action :run
only_if {
not ::File.exists?("#{Chef::Config['file_cache_path']}/ext-solr-#{new_resource.extension}.tgz")
not ::File.exists?("#{Chef::Config['file_cache_path']}/ext-solr/README.md")
}
code <<-EOF
rsync --delete -auvz --progress -e "ssh -o StrictHostKeyChecking=no" \
--no-o --no-g deploy@deploy.sgalinski.de:~/solr/ext-solr-#{new_resource.extension}.tgz \
"#{Chef::Config['file_cache_path']}/ext-solr-#{new_resource.extension}.tgz";
cd #{Chef::Config['file_cache_path']};
tar -xzf ext-solr-#{new_resource.extension}.tgz;
EOF
end
# Unpack and copy directories to the final location
# Copy extension configuration to the final location
bash 'Copy TYPO3 Solr configuration' do
user 'root'
timeout 3000000
action :run
only_if {
not ::File.exists?("#{Chef::Config['file_cache_path']}/ext-solr/README.md")
}
code <<-EOF
cd #{Chef::Config['file_cache_path']};
tar -xzf ext-solr-#{new_resource.extension}.tgz;
cd #{node['typo3_solr']['solr']['solr_home']};
rm -rf server/solr/configsets/ && cp -a #{Chef::Config['file_cache_path']}/ext-solr/Resources/Private/Solr/configsets server/solr/configsets/;
rm -rf server/solr/cores/ && cp -a #{Chef::Config['file_cache_path']}/ext-solr/Resources/Private/Solr/cores server/solr/;
cp -a #{Chef::Config['file_cache_path']}/ext-solr/Resources/Private/Solr/cores server/solr/;
cp -a #{Chef::Config['file_cache_path']}/ext-solr/Resources/Private/Solr/solr.xml server/solr/;
chown solr:root -R #{node['typo3_solr']['solr']['solr_home']};
EOF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment