From 7cad434189a4b3afb49a88df20f7c4a303f1d47c Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sun, 25 Nov 2018 11:07:17 +0100 Subject: Set up image pushing and building on Azure. (#152) Closes #152. --- azure-pipelines.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'azure-pipelines.yml') diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 90232430..1c6a746a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,6 +55,9 @@ jobs: - job: test displayName: Test + dependsOn: + - lint_misc + - lint_python pool: vmImage: ubuntu-16.04 strategy: @@ -112,5 +115,25 @@ jobs: testResultsFiles: "**/TEST-*.xml" testRunTitle: 'Python $(python.version) with PostgreSQL $(postgres.version)' + - job: push_image + displayName: Push Docker image + dependsOn: test + condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/django')) + pool: + vmImage: ubuntu-16.04 + + steps: + - task: Docker@1 + displayName: Login to Docker Hub + + inputs: + containerregistrytype: 'Container Registry' + dockerRegistryEndpoint: 'DockerHub' + command: 'login' + + - script: | + docker build -t pythondiscord/django:latest . + docker push pythondiscord/django:latest + displayName: Build and push the image # vim: sw=2 ts=2: -- cgit v1.2.3