diff options
author | Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com> | 2019-08-22 18:28:15 +0300 |
---|---|---|
committer | Paul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com> | 2019-08-22 18:28:15 +0300 |
commit | 07fc4b0dcd8eef5ca7463faeb71e2146224a8df0 (patch) | |
tree | fff9a43a98baba57bbdc6708ec65d137ede9e8ff /.travis.yml | |
parent | 1a4e81c218d8e56f367b61b17d5f8e71a2cbb40b (diff) |
.travis.yml: Build docker images in parallel (#6672)
* packaging/docker/{build,publish}.sh: Ability to externally defined ARCHS
* .travis.yml: Run docker build and release jobs in parallel
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 119 |
1 files changed, 80 insertions, 39 deletions
diff --git a/.travis.yml b/.travis.yml index bb6055eaa8..4f2da2b93f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,7 +60,8 @@ stages: if: branch = master AND type != pull_request AND type != cron - name: Publish for release - if: branch = master AND type != pull_request AND type != cron AND commit_message =~ /(\[netdata release candidate\]|\[netdata major release\]|\[netdata minor release\]|\[netdata patch release\])/ + # We don't run on release candidates + if: branch = master AND type != pull_request AND type != cron AND commit_message =~ /(\[netdata release candidate\]|\[netdata major release\]|\[netdata minor release\]|\[netdata patch release\])/ AND tag !~ /(-rc)/ # Build DEB packages under special conditions - name: Package ubuntu/* and debian/* @@ -475,26 +476,48 @@ jobs: # We only publish if a TAG has been set during packaging - stage: Publish for release + _template: &RELEASE_TEMPLATE + git: + depth: false + before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images" "${NOTIF_CHANNEL}" + script: + - echo "GIT Branch:" && git branch + - echo "Last commit:" && git log -1 + - echo "GIT Describe:" && git describe + - echo "packaging/version:" && cat packaging/version + - packaging/docker/check_login.sh + - echo "Switching to latest master branch, to pick up tagging if any" && git checkout master && git pull + - packaging/docker/build.sh + - packaging/docker/publish.sh + after_failure: post_message "TRAVIS_MESSAGE" "<!here> Docker image publishing failed" + + name: Build & Publish docker image for i386 + <<: *RELEASE_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=i386 - name: Build & Publish docker images - before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images" "${NOTIF_CHANNEL}" - script: - - echo "GIT Branch:" && git branch - - echo "Last commit:" && git log -1 - - echo "GIT Describe:" && git describe - - echo "packaging/version:" && cat packaging/version - - packaging/docker/check_login.sh - - echo "Switching to latest master branch, to pick up tagging if any" && git checkout master && git pull - - packaging/docker/build.sh - - packaging/docker/publish.sh - after_failure: post_message "TRAVIS_MESSAGE" "<!here> Docker image publishing failed" - git: - depth: false - env: ALLOW_SOFT_FAILURE_HERE=true - # We don't run on release candidates - if: tag !~ /(-rc)/ + - name: Build & Publish docker image for amd64 + <<: *RELEASE_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=amd64 + + - name: Build & Publish docker image for armhf + <<: *RELEASE_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=armhf + + - name: Build & Publish docker image for aarch64 + <<: *RELEASE_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=aarch64 - name: Create release draft + git: + depth: false before_script: post_message "TRAVIS_MESSAGE" "Drafting release on github" "${NOTIF_CHANNEL}" script: - echo "GIT Branch:" && git branch @@ -503,11 +526,7 @@ jobs: - echo "packaging/version:" && cat packaging/version - echo "Generating release artifacts" && .travis/create_artifacts.sh # Could/should be a common storage to put this and share between jobs - .travis/draft_release.sh - git: - depth: false after_failure: post_message "TRAVIS_MESSAGE" "<!here> Draft release submission failed" - # We don't run on release candidates - if: tag !~ /(-rc)/ @@ -540,8 +559,46 @@ jobs: # This is the nightly execution step # - stage: Nightly release + _template: &NIGHTLY_TEMPLATE + git: + depth: false + before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images for nightlies" "${NOTIF_CHANNEL}" + script: + - echo "GIT Branch:" && git branch + - echo "Last commit:" && git log -1 + - echo "GIT Describe:" && git describe + - echo "packaging/version:" && cat packaging/version + - docker info + - packaging/docker/check_login.sh + - packaging/docker/build.sh + - packaging/docker/publish.sh + after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly docker image publish failed" + + name: Build & Publish docker image for i386 + <<: *NIGHTLY_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=i386 + + - name: Build & Publish docker image for amd64 + <<: *NIGHTLY_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=amd64 + + - name: Build & Publish docker image for armhf + <<: *NIGHTLY_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=armhf + + - name: Build & Publish docker image for aarch64 + <<: *NIGHTLY_TEMPLATE + env: + - ALLOW_SOFT_FAILURE_HERE=true + - ARCHS=aarch64 - name: Trigger .RPM and .DEB package generation + - name: Trigger .RPM and .DEB package generation before_script: post_message "TRAVIS_MESSAGE" "Starting RPM and DEB package generation for nightlies" "${NOTIF_CHANNEL}" script: - .travis/trigger_package_generation.sh "[Build latest]" @@ -549,22 +606,6 @@ jobs: git: depth: false - - name: Build & Publish docker images - before_script: post_message "TRAVIS_MESSAGE" "Publishing docker images for nightlies" "${NOTIF_CHANNEL}" - script: - - echo "GIT Branch:" && git branch - - echo "Last commit:" && git log -1 - - echo "GIT Describe:" && git describe - - echo "packaging/version:" && cat packaging/version - - docker info - - packaging/docker/check_login.sh - - packaging/docker/build.sh - - packaging/docker/publish.sh - after_failure: post_message "TRAVIS_MESSAGE" "<!here> Nightly docker image publish failed" - git: - depth: false - env: ALLOW_SOFT_FAILURE_HERE=true - - name: Create nightly release artifacts, publish to GCS before_script: post_message "TRAVIS_MESSAGE" "Starting artifacts generation for nightlies" "${NOTIF_CHANNEL}" script: |