Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Merge details:

commit e400ff3
Author: Jelle Sebreghts <[email protected]>
Date:   Mon Mar 11 08:39:16 2019

    Fix codestyle, do not test PHP5.

commit b3d5a28
Author: Jelle Sebreghts <[email protected]>
Date:   Thu Feb 28 15:40:15 2019

    Add filechecks to allow deploys to check if certain files are present.
  • Loading branch information
Jelle-S committed Mar 11, 2019
2 parents 9559181 + f51099e commit fc388d3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ language: php
php:
- 7.1
- 7.0
- 5.6
- 5.5
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
Expand All @@ -18,4 +16,4 @@ script:
- vendor/bin/phpunit
after_script:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"digipolisgent/robo-digipolis-package": "^0.1",
"digipolisgent/robo-digipolis-deploy": "^0.1.4",
"digipolisgent/robo-digipolis-general": "^0.1",
"gordalina/cachetool": "^3|^2.1|^1.11"
"gordalina/cachetool": "^3|^2.1|^1.11",
"digipolisgent/command-builder": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
Expand Down
24 changes: 24 additions & 0 deletions src/AbstractRoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace DigipolisGent\Robo\Helpers;

use DigipolisGent\CommandBuilder\CommandBuilder;
use DigipolisGent\Robo\Task\Deploy\Ssh\Auth\AbstractAuth;
use DigipolisGent\Robo\Task\Deploy\Ssh\Auth\KeyFile;
use DigipolisGent\Robo\Task\General\Common\DigipolisPropertiesAwareInterface;
Expand Down Expand Up @@ -330,6 +331,29 @@ protected function buildTask($archivename = null)
*/
protected function postSymlinkTask($worker, AbstractAuth $auth, $remote)
{
if (isset($remote['postsymlink_filechecks']) && $remote['postsymlink_filechecks']) {
$projectRoot = $remote['rootdir'];
$collection = $this->collectionBuilder();
$collection->taskSsh($worker, $auth)
->remoteDirectory($projectRoot, true)
->timeout($this->getTimeoutSetting('postsymlink_filechecks'));
foreach ($remote['postsymlink_filechecks'] as $file) {
// If this command fails, the collection will fail, which will
// trigger a rollback.
$builder = CommandBuilder::create('ls')
->addArgument($file)
->pipeOutputTo('grep')
->addArgument($file)
->onFailure(
CommandBuilder::create('echo')
->addArgument('[ERROR] ' . $file . ' was not found.')
->onFinished('exit')
->addArgument('1')
);
$collection->exec((string) $builder);
}
return $collection;
}
return false;
}

Expand Down

0 comments on commit fc388d3

Please sign in to comment.