Added simple check if the shell on remote server is POSIX-compliant.

This commit is contained in:
Paulina Budzon 2015-05-11 14:04:14 +01:00
parent 5a53b0ade9
commit 598773719e

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");