drone-ssh: Deploy steps continue even if command returns error
Is there any way to abort execution on error? for instance right now In my deployment code I run gulp through your ssh plugin, if gulp returns a compile error I want to abort, but currently that does not happen.
I am going to wrap all my build steps in a bash script with stricter error handling, but I wanted to check if there was another way first.
Here’s what my .drone.yml currently looks like
deploy:
ssh:
host: gwizlv-prd01
user: crun
port: 22
commands:
- setenv build `date +%s`
- setenv appdir "/mnt/shared/sites/people"
- mkdir $appdir/releases/$build/
- cd $appdir/releases/$build/
- git clone <git repo> ./
- composer install --no-interaction
- cp .env.production .env
- phpunit
- rm -rf storage
- ln -s $appdir/storage storage
- php artisan clear-compiled
- php artisan optimize
- npm install
- gulp
- php artisan migrate --no-interaction --force
- find ./ -type d -exec chmod 775 {} +
- find ./ -type f -exec chmod 664 {} +
- cd $appdir
- ln -n -f -s $appdir/releases/$build $appdir/release
- ln -n -f -s $appdir/releases/$build $appdir/last_release
when:
branch: master
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 24 (13 by maintainers)
@mattbucci Please add
set -e