I have the following pipeline. Please, how do I ensure that the deployment step is done ONLY if the "Build and Test" step passes?
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.2
# Doing a full clone to be able to push back to Heroku.
clone:
depth: full
pipelines:
branches:
master:
- step:
name: Build and Test
caches:
- composer
script:
- apt-get update && apt-get install -y unzip git
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- cp .env.testing .env
- vendor/bin/phpunit
- step:
name: Deploy to Heroku
deployment: staging
script:
- apt-get update && apt-get install -y git
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD
Hi Acho,
Bitbucket Pipelines runs steps sequentially. So the 'Deploy to Heroku' step will not begin execution until your 'Build and Test' step completes successfully.
If any steps fail to complete successfully (e.g. a test fails), then the entire pipeline will stop executing.
Have you been seeing different behaviour?
Thanks,
Phil
Thanks @Philip Hodder I didn't know that was the normal behaviour
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.