Merge pull request #249 from pbudzon/master

Added simple check if the shell on remote server is POSIX-compliant.
This commit is contained in:
Anton Medvedev 2015-05-11 23:54:32 +07:00
commit 0fe81e9eb1

View File

@ -54,6 +54,15 @@ task('rollback', function () {
* Preparing server for deployment.
*/
task('deploy:prepare', function () {
// Simple IF to check if shell is POSIX-compliant
try {
run('if [ ! -d {{deploy_path}} ]; then echo ""; fi');
}
catch(\RuntimeException $e){
throw new \RuntimeException('Shell on your server is not POSIX-compliant. Please change to sh, bash or similar. '
.PHP_EOL.'Usually, you can change your shell to bash by running: chsh -s /bin/bash');
}
// Create releases dir.
run("cd {{deploy_path}} && if [ ! -d releases ]; then mkdir releases; fi");