diff options
author | 2019-09-14 13:54:33 -0700 | |
---|---|---|
committer | 2019-09-14 14:00:41 -0700 | |
commit | 25fb9bebf815f305e8cd569c5bbe79425b44597d (patch) | |
tree | ca62b787f63920558f5dd1657f5633b518bfd1cd | |
parent | Merge pull request #43 from python-discord/revitalisation (diff) |
CI: ditch Docker v2 tasks
-rw-r--r-- | azure-pipelines.yml | 72 |
1 files changed, 32 insertions, 40 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33d3efc..2fa8a1a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,35 +15,32 @@ jobs: scriptPath: scripts/check_dockerfiles.sh # Without a login the following Docker build tasks won't add image tags. - - task: Docker@2 + - task: Docker@1 displayName: 'Log into Docker Hub' inputs: command: login - containerRegistry: DockerHubV2 + containerregistrytype: 'Container Registry' + dockerRegistryEndpoint: 'DockerHub' # The venv image depends on this image. Build it if it can't be pulled # from Docker Hub, which will be the case if the base Dockerfile has had # changes. - - task: Docker@2 + - script: | + docker build \ + -f docker/base.Dockerfile \ + -t pythondiscord/snekbox-base:latest \ + . displayName: 'Build Base Image' condition: and(succeeded(), ne(variables['check.BASE_PULL'], True)) - inputs: - command: build - repository: pythondiscord/snekbox-base - tags: latest - Dockerfile: docker/base.Dockerfile - buildContext: . # The dev image is never pushed and therefore is always built. - - task: Docker@2 + - script: | + docker build \ + -f docker/venv.Dockerfile \ + -t pythondiscord/snekbox-venv:dev \ + --build-arg DEV=1 \ + . displayName: 'Build Development Image' - inputs: - command: build - repository: pythondiscord/snekbox-venv - tags: dev - Dockerfile: docker/venv.Dockerfile - buildContext: . - arguments: --build-arg DEV=1 # The linter and all tests run inside this container. - script: | @@ -127,16 +124,21 @@ jobs: BASE_PULL: $[ coalesce(dependencies.test.outputs['check.BASE_PULL'], False) ] steps: - - task: Docker@2 + - task: Docker@1 displayName: 'Log into Docker Hub' inputs: command: login - containerRegistry: DockerHubV2 + containerregistrytype: 'Container Registry' + dockerRegistryEndpoint: 'DockerHub' # Because this is the base image for the venv image, if the venv needs to # be built, this base image must also be present. Build it if it has # changed or can't be pulled from Docker Hub. - - task: Docker@2 + - script: | + docker build \ + -f docker/base.Dockerfile \ + -t pythondiscord/snekbox-base:latest \ + . displayName: 'Build Base Image' condition: > and( @@ -147,15 +149,13 @@ jobs: eq(variables.VENV_CHANGED, True) ) ) - inputs: - command: build - repository: pythondiscord/snekbox-base - tags: latest - Dockerfile: docker/base.Dockerfile - buildContext: . # Also build this image if base has changed - even if this image hasn't. - - task: Docker@2 + - script: | + docker build \ + -f docker/venv.Dockerfile \ + -t pythondiscord/snekbox-venv:latest \ + . displayName: 'Build Virtual Environment Image' condition: > and( @@ -165,23 +165,15 @@ jobs: eq(variables.VENV_CHANGED, True) ) ) - inputs: - command: build - repository: pythondiscord/snekbox-venv - tags: latest - Dockerfile: docker/venv.Dockerfile - buildContext: . # Always build this image unless it's for a pull request. - - task: Docker@2 + - script: | + docker build \ + -f docker/Dockerfile \ + -t pythondiscord/snekbox:latest \ + . displayName: 'Build Final Image' condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - inputs: - command: build - repository: pythondiscord/snekbox - tags: latest - Dockerfile: docker/Dockerfile - buildContext: . # Push images only after they've all successfully been built. # These have the same conditions as the build tasks. However, for safety, |