From c2c3a9873a2f4a2781637d0fe0a595be10527011 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 12 Aug 2020 16:51:44 -0700 Subject: [PATCH] prepare build job --- .azure-pipelines/advanced-test.yml | 5 +++++ .azure-pipelines/nightly.yml | 3 +++ .azure-pipelines/release.yml | 4 +++- .../templates/jobs/packaging-jobs.yml | 17 ++++++++++++++--- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 7a9bb588b..e2342630f 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -5,5 +5,10 @@ trigger: - test-* pr: none +variables: + # We don't publish our Docker images in this pipeline, but when building them + # for testing, let's use the nightly tag. + dockerTag: nightly + stages: - template: templates/stages/test-and-package-stage.yml diff --git a/.azure-pipelines/nightly.yml b/.azure-pipelines/nightly.yml index 1d3261fb6..dd2930c41 100644 --- a/.azure-pipelines/nightly.yml +++ b/.azure-pipelines/nightly.yml @@ -9,6 +9,9 @@ schedules: - master always: true +variables: + dockerTag: nightly + stages: - template: templates/stages/test-and-package-stage.yml - template: templates/stages/deploy-stage.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index b00d4be78..eaa9be0fd 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -6,11 +6,13 @@ trigger: - v* pr: none +variables: + dockerTag: ${{variables['Build.SourceBranchName']}} + stages: - template: templates/stages/test-and-package-stage.yml - template: templates/stages/changelog-stage.yml - template: templates/stages/deploy-stage.yml parameters: snapReleaseChannel: beta - dockerTag: ${{variables['Build.SourceBranchName']}} - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index 02eeff3a3..00160cbb1 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -3,10 +3,21 @@ jobs: pool: vmImage: ubuntu-18.04 steps: - - bash: | - tools/docker/build.sh $(dockerTag) - docker images --filter reference='*/dns-*' --filter reference='*/certbot' + - bash: tools/docker/build.sh ${{ variables.dockerTag }} displayName: Build the Docker images + # We don't filter for the Docker Hub organization to continue to allow + # easy testing of these scripts on forks. + - bash: | + DOCKER_IMAGES=$(docker images --quiet --filter reference='*/dns-*' --filter reference='*/certbot') + docker save --output docker_images.tar $DOCKER_IMAGES + displayName: Save the Docker images + - bash: mv docker_images.tar $(Build.ArtifactStagingDirectory) + displayName: Prepare Docker artifact + - task: PublishPipelineArtifact@1 + inputs: + path: $(Build.ArtifactStagingDirectory) + artifact: docker_images + displayName: Store Docker artifact - job: installer_build pool: vmImage: vs2017-win2016