cd-ci-glue
|
Functions | |
is_travis_branch_push (branch) | |
Check if invoked from Travis CI due to a push event on a specific branch. More... | |
is_travis_master_push () | |
Check if invoked from Travis CI due to push on master branch. More... | |
is_travis_cron () | |
Check if invoked from Travis CI due to a cron event. More... | |
is_travis_branch_push | ( | branch | ) |
Check if invoked from Travis CI due to a push event on a specific branch.
branch | Branch name to compare to |
Return a zero status code if this is refering to a push on the branch given as argument. If any of the required environment variables are missing, will emit error message on stderr, but containue anyway and assume that this is not a push event on the desired branch. Please note that this might break your script execution if running with -o pipefail
and/or set -eE
. A work-around for that fact is described below in the example section.
# Below will fail on -opipefail, -eE etc.
$ is_travis_branch_push devel && dockerhub_push_image madworx/qemu:dev
# Below is a work-around for above behaviour.
$ ! is_travis_branch_push devel && true || dockerhub_push_image madworx/qemu:dev
is_travis_cron | ( | ) |
Check if invoked from Travis CI due to a cron event.
Return a zero status code if this is triggerd by Travis cron.
is_travis_master_push | ( | ) |
Check if invoked from Travis CI due to push on master
branch.
Return a zero status code if this is referring to a push to the master
branch.
# Below will fail on -opipefail, -eE etc.
$ is_travis_master_push && dockerhub_push_image madworx/qemu
# Below is a work-around for above behaviour.
$ ! is_travis_master_push && true || dockerhub_push_image madworx/qemu