Browse Source

Merge pull request #180 from MovingImage24/dump_symlinks

make h option for targz optional, default is set h option
1.0
Andrés Montañez 10 years ago
parent
commit
1cf7c56c39
  1. 5
      Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php
  2. 43
      docs/example-config/.mage/config/environment/production.yml.dump-symlinks.txt

5
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

43
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:
Loading…
Cancel
Save