File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ language: php
55php :
66 - 7.1
77 - 7.0
8- - 5.6
9- - 5.5
108before_script :
119 - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
1210 - chmod +x ./cc-test-reporter
@@ -18,4 +16,4 @@ script:
1816 - vendor/bin/phpunit
1917after_script :
2018 - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
21-
19+
Original file line number Diff line number Diff line change 88 "digipolisgent/robo-digipolis-package" : " ^0.1" ,
99 "digipolisgent/robo-digipolis-deploy" : " ^0.1.4" ,
1010 "digipolisgent/robo-digipolis-general" : " ^0.1" ,
11- "gordalina/cachetool" : " ^3|^2.1|^1.11"
11+ "gordalina/cachetool" : " ^3|^2.1|^1.11" ,
12+ "digipolisgent/command-builder" : " ^1.0"
1213 },
1314 "require-dev" : {
1415 "phpunit/phpunit" : " ~4.4"
Original file line number Diff line number Diff line change 22
33namespace DigipolisGent \Robo \Helpers ;
44
5+ use DigipolisGent \CommandBuilder \CommandBuilder ;
56use DigipolisGent \Robo \Task \Deploy \Ssh \Auth \AbstractAuth ;
67use DigipolisGent \Robo \Task \Deploy \Ssh \Auth \KeyFile ;
78use DigipolisGent \Robo \Task \General \Common \DigipolisPropertiesAwareInterface ;
@@ -330,6 +331,29 @@ protected function buildTask($archivename = null)
330331 */
331332 protected function postSymlinkTask ($ worker , AbstractAuth $ auth , $ remote )
332333 {
334+ if (isset ($ remote ['postsymlink_filechecks ' ]) && $ remote ['postsymlink_filechecks ' ]) {
335+ $ projectRoot = $ remote ['rootdir ' ];
336+ $ collection = $ this ->collectionBuilder ();
337+ $ collection ->taskSsh ($ worker , $ auth )
338+ ->remoteDirectory ($ projectRoot , true )
339+ ->timeout ($ this ->getTimeoutSetting ('postsymlink_filechecks ' ));
340+ foreach ($ remote ['postsymlink_filechecks ' ] as $ file ) {
341+ // If this command fails, the collection will fail, which will
342+ // trigger a rollback.
343+ $ builder = CommandBuilder::create ('ls ' )
344+ ->addArgument ($ file )
345+ ->pipeOutputTo ('grep ' )
346+ ->addArgument ($ file )
347+ ->onFailure (
348+ CommandBuilder::create ('echo ' )
349+ ->addArgument ('[ERROR] ' . $ file . ' was not found. ' )
350+ ->onFinished ('exit ' )
351+ ->addArgument ('1 ' )
352+ );
353+ $ collection ->exec ((string ) $ builder );
354+ }
355+ return $ collection ;
356+ }
333357 return false ;
334358 }
335359
You can’t perform that action at this time.
0 commit comments