--- env: global: - FORCE_BUILD=true # We use backticks in favor of the proper $() subshell call to cope with the # evaluation of Travis CI. Else we had trouble with the braces of the regex. # The regex matches on subdirectories only - identified by the trailing /. - TO_BUILD=`git diff --name-only $TRAVIS_COMMIT_RANGE HEAD | grep -oP '^.*?(?=\/)' | uniq | tr -s "\n" ":" || exit 0` jobs: include: - &build_and_run stage: build and run images env: KERNEL=4.15.0-72-generic SUITE=xenial # Only run this job when there are changes in the subdir 'debirf' # Attention: Travis CI is only parsing this file if the condition is met. # before_install: git diff --name-only $TRAVIS_COMMIT_RANGE HEAD | grep -qP '^debirf/' && env before_install: env # Verbose if conditional instead pure [[ ]] - else this won't work in this YAML file. # TODO: Check if TRAVIS_EVENT_TYPE is cron to trigger builds of daily cron jobs before_script: - | if [[ $FORCE_BUILD = true ]]; then echo 'Forcing build - even if there are no changes in ./debirf' else if ! [[ "$TRAVIS_EVENT_TYPE" = "cron" ]] && ! [[ "$TO_BUILD" = *"debirf"* ]]; then exit 0 fi fi dist: bionic language: bash script: ./debirf/build_and_run_images # Tag generation with 'date' comes with a newline to strip off. # Use 'printf' instead. before_deploy: - git config --global user.email "build@travis-ci.com" - git config --global user.name "Travis CI" - export TRAVIS_TAG=$(printf '%(%Y%m%d)T') - git tag -a "$TRAVIS_TAG" -m 'Automatic release by Travis CI' deploy: provider: releases draft: false edge: true api_key: ${TOKEN} file_glob: true file: debirf/build/* cleanup: false on: branch: master - <<: *build_and_run env: KERNEL=5.0.0-37-generic SUITE=disco - &run_coinboot env: KERNEL=4.15.0-72-generic SUITE=xenial stage: run coinboot before_script: - | if [[ $FORCE_BUILD = true ]]; then echo 'Forcing build - even if there are no changes in ./debirf' else if ! [[ "$TRAVIS_EVENT_TYPE" = "cron" ]] && ! [[ "$TO_BUILD" = *"server"* ]]; then exit 0 fi fi dist: bionic language: bash script: ./server/run_coinboot # - <<: *run_coinboot # env: KERNEL=4.15.0-45-generic SUITE=xenial - <<: *run_coinboot env: KERNEL=5.0.0-37-generic SUITE=disco