From 4cdb95f3beb1aaaa11010b01a92cd5a33d4c0f9d Mon Sep 17 00:00:00 2001 From: Alexander Miehe Date: Mon, 12 Jan 2015 19:50:19 +0100 Subject: [PATCH 1/3] make h option for targz optional, default is set h option --- Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php index 9bb1b25..625bd7b 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php @@ -77,7 +77,10 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware $strategyFlags = ''; } - $command = 'tar cfzh' . $strategyFlags . ' ' . $localTarGz . '.tar.gz ' . $excludeCmd . $excludeFromFileCmd . ' -C ' . $this->getConfig()->deployment('from') . ' .'; + // remove h option only if dump_symlinks is allowed in the release config part + $dumpSymlinks = $this->getConfig()->release('dump_symlinks') ? '' : 'h'; + + $command = 'tar cfz'. $dumpSymlinks . $strategyFlags . ' ' . $localTarGz . '.tar.gz ' . $excludeCmd . $excludeFromFileCmd . ' -C ' . $this->getConfig()->deployment('from') . ' .'; $result = $this->runCommandLocal($command); // Strategy Flags From 55a5c0c640f939d0164fbea503467e4102c71709 Mon Sep 17 00:00:00 2001 From: Alexander Miehe Date: Wed, 14 Jan 2015 09:30:52 +0100 Subject: [PATCH 2/3] Fix key name to follow naming convention --- Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php index 625bd7b..ba16246 100644 --- a/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php +++ b/Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php @@ -77,8 +77,8 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware $strategyFlags = ''; } - // remove h option only if dump_symlinks is allowed in the release config part - $dumpSymlinks = $this->getConfig()->release('dump_symlinks') ? '' : 'h'; + // remove h option only if dump-symlinks is allowed in the release config part + $dumpSymlinks = $this->getConfig()->release('dump-symlinks') ? '' : 'h'; $command = 'tar cfz'. $dumpSymlinks . $strategyFlags . ' ' . $localTarGz . '.tar.gz ' . $excludeCmd . $excludeFromFileCmd . ' -C ' . $this->getConfig()->deployment('from') . ' .'; $result = $this->runCommandLocal($command); From 1a81e7000ba347b680972d7d92440a0c74c62e38 Mon Sep 17 00:00:00 2001 From: Alexander Miehe Date: Wed, 14 Jan 2015 11:49:31 +0100 Subject: [PATCH 3/3] Add example config with explanation --- .../production.yml.dump-symlinks.txt | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/example-config/.mage/config/environment/production.yml.dump-symlinks.txt diff --git a/docs/example-config/.mage/config/environment/production.yml.dump-symlinks.txt b/docs/example-config/.mage/config/environment/production.yml.dump-symlinks.txt new file mode 100644 index 0000000..1ff2547 --- /dev/null +++ b/docs/example-config/.mage/config/environment/production.yml.dump-symlinks.txt @@ -0,0 +1,43 @@ +#production +deployment: + user: root + from: ./ +# source: +# type: git +# repository: git://github.com/andres-montanez/Magallanes.git +# from: master +# temporal: /tmp/myAppClone + to: /var/www/vhosts/example.com/www + excludes: + - application/data/cache/twig/* +releases: + enabled: true + max: 5 + symlink: current + directory: releases +# This option allows to dump the symlink with the TarGz strategy and use the symlink on the deployment host. +# This is useful, if the files the symlink point to only exist on the deployment host and not on the host who runs the mage command. +# The default value is false to keep bc. +# See : http://linux.die.net/man/1/tar -h, --dereference + dump-symlinks: true +hosts: + - s01.example.com + - s02.example.com +# s02.example.com: +# deployment: +# user: toor +# to: /home/web/public +# releases: +# max: 10 +# tasks: +# on-deploy: +# - privileges +tasks: + pre-deploy: + - scm/update + on-deploy: + - symfony2/cache-warmup: { env: prod } + - privileges + - sampleTask + - sampleTaskRollbackAware + #post-deploy: