Compare commits

...

9 Commits

Author SHA1 Message Date
Brad Warren
f7eb5b79fc fix docker images command 2020-08-13 11:08:53 -07:00
Brad Warren
112e1e7ab9 add displayName 2020-08-13 10:06:33 -07:00
Brad Warren
c86ec104a2 remove old dockerTag param 2020-08-12 17:09:32 -07:00
Brad Warren
423be6c388 Update deploy stage. 2020-08-12 17:04:38 -07:00
Brad Warren
ae7aef9db5 change variable syntax 2020-08-12 16:57:43 -07:00
Brad Warren
c2c3a9873a prepare build job 2020-08-12 16:51:44 -07:00
Brad Warren
325f51aba5 Error if TAG_BASE is empty. 2020-08-12 16:38:55 -07:00
Brad Warren
d7386bd962 require global variable? 2020-08-12 16:33:43 -07:00
Brad Warren
90091c557d Build docker images during testing/packaging. 2020-08-12 15:11:31 -07:00
7 changed files with 48 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,25 @@
jobs:
- job: docker_build
pool:
vmImage: ubuntu-18.04
steps:
- bash: tools/docker/build.sh $(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 --filter reference='*/certbot' --filter reference='*/dns-*' --format '{{.Repository}}')
docker save --output docker_images.tar $DOCKER_IMAGES
displayName: Save the Docker images
# If the name of the tar file or artifact changes, the deploy stage will
# also need to be updated.
- 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

View File

@@ -5,9 +5,6 @@ parameters:
values:
- edge
- beta
- name: dockerTag
type: string
default: nightly
stages:
- stage: Deploy
@@ -66,6 +63,13 @@ stages:
pool:
vmImage: ubuntu-18.04
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: docker_images
path: $(Build.SourcesDirectory)
displayName: Retrieve Docker images
- bash: docker load --input $(Build.SourcesDirectory)/docker_images.tar
displayName: Load Docker images
- task: Docker@2
inputs:
command: login
@@ -81,7 +85,5 @@ stages:
# Certbot organization on Docker Hub.
containerRegistry: docker-hub
displayName: Login to Docker Hub
- bash: tools/docker/build.sh ${{ parameters.dockerTag }}
displayName: Build the Docker images
- bash: tools/docker/deploy.sh ${{ parameters.dockerTag }}
- bash: tools/docker/deploy.sh $(dockerTag)
displayName: Deploy the Docker images

View File

@@ -51,6 +51,10 @@ Build() {
}
TAG_BASE="$1"
if [ -z "$TAG_BASE" ]; then
echo "We cannot tag Docker images with an empty string!" >&2
exit 1
fi
# Step 1: Certbot core Docker
Build "$DOCKER_HUB_ORG/certbot" "$TAG_BASE" "$REPO_ROOT" "$WORK_DIR/core"

View File

@@ -24,6 +24,10 @@ Deploy() {
}
TAG_BASE="$1" # Eg. v0.35.0 or nightly
if [ -z "$TAG_BASE" ]; then
echo "We cannot tag Docker images with an empty string!" >&2
exit 1
fi
source "$WORK_DIR/lib/common"
# Step 1: Certbot core Docker