Make a ":latest" tag, and a SHA1 commit ID one too.

Latest is horrible and makes debugging what has happened anywhere a
nightmare. We push a latest because of demand for it, but we'll also
push a SHA1 commit id so those wanting to know what they're running
(and be able to roll back if required) can use those instead.

Note that latest here is defined as "most recent master commit" not
"most recent released version", as the actual semantics of making latest
correct while still being able to build bugfixed releases of previous
versions is just ARGH. So we define it as "master" not "latest release".
This commit is contained in:
Michael Kaye 2018-09-27 11:44:21 +01:00
parent a3c11f7320
commit 8607397ea7
1 changed files with 16 additions and 3 deletions

View File

@ -1,12 +1,21 @@
version: 2 version: 2
jobs: jobs:
dockerhubupload: dockerhubuploadrelease:
machine: true machine: true
steps: steps:
- checkout - checkout
- run: docker build -f docker/Dockerfile -t matrixdotorg/synapse:$CIRCLE_TAG . - run: docker build -f docker/Dockerfile -t matrixdotorg/synapse:$CIRCLE_TAG .
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD - run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
- run: docker push - run: docker push matrixdotorg/synapse:$CIRCLE_TAG
dockerhubuploadlatest:
machine: true
steps:
- checkout
- run: docker build -f docker/Dockerfile -t matrixdotorg/synapse:$CIRCLE_SHA1 .
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
- run: docker tag matrixdotorg/synapse:$CIRCLE_SHA1 matrixdotorg/synapse:latest
- run: docker push matrixdotorg/synapse:$CIRCLE_SHA1
- run: docker push matrixdotorg/synapse:latest
sytestpy2: sytestpy2:
machine: true machine: true
steps: steps:
@ -138,9 +147,13 @@ workflows:
filters: filters:
branches: branches:
ignore: /develop|master|release-.*/ ignore: /develop|master|release-.*/
- dockerhubupload: - dockerhubuploadrelease:
filters: filters:
tags: tags:
only: /^v[0-9].[0-9]+.[0-9]+(.[0-9]+)?/ only: /^v[0-9].[0-9]+.[0-9]+(.[0-9]+)?/
branches: branches:
ignore: /.*/ ignore: /.*/
- dockerhubuploadlatest:
filters:
branches:
only: master