Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Build and push docker image to hub automatically #3946

Merged
merged 6 commits into from
Sep 27, 2018

Conversation

michaelkaye
Copy link
Contributor

Automate pushing docker images.

Questions - do we want to build any other tags? Is that regex good enough for tags we want to build or do we have a more precise naming scheme. I was hesitant to just look for all tags starting "v" in case we tag something "very_broken_build".

@michaelkaye
Copy link
Contributor Author

The earlier code mistakenly allowed all branches and only those tags - we're now building on only those tags and no branches.

tags:
only: /^v[0-9].[0-9]+.[0-9]+(.[0-9]+)?/
branches:
ignore: /.*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please get a :latest for master?

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".
@michaelkaye michaelkaye force-pushed the michaelkaye/automate_docker_hub_upload branch from d546bb9 to 74bbdd0 Compare September 27, 2018 11:02
@michaelkaye
Copy link
Contributor Author

(rebased against develop to pull in hawkowls' changes)

@michaelkaye michaelkaye requested a review from a team September 27, 2018 11:03
@michaelkaye michaelkaye changed the base branch from develop to master September 27, 2018 11:04
@michaelkaye michaelkaye changed the base branch from master to develop September 27, 2018 11:04
@michaelkaye
Copy link
Contributor Author

This will need two environment variables adding to CircleCI : https://circleci.com/gh/matrix-org/synapse/edit#env-vars

DOCKER_HUB_USERNAME - doesn't need to be matrixdotorg, can be another user who is a contributor to just the synapse project (to minimize access)
DOCKER_HUB_PASSWORD - the user's password to log into docker hub.

We should be aware that someone who can change the .circleci/config.yml and cause a PR or branch to be build which contains, for example: "run: echo $DOCKER_HUB_PASSWORD" will be able to obtain our credentials. This is our responsibility as reviewers to never permit those PRs to be merged to or created within this repository.

We do not pass these secrets to PRs from forks of this repository - so only those with commit or merge access to this repository are able to obtain these secrets - specifically we must never set https://circleci.com/gh/matrix-org/synapse/edit#advanced-settings the "pass secrets to builds of forks of this repository"

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, though I'm confused about whether you want to merge it to master or not

@michaelkaye
Copy link
Contributor Author

Let's just leave it on develop and watch it as we make the release candidate.

@michaelkaye
Copy link
Contributor Author

we might need to make a tweak to the rc branch if it doesn't build cleanly, but shrug

@richvdh richvdh merged commit b5c9763 into develop Sep 27, 2018
@DMRobertson DMRobertson deleted the michaelkaye/automate_docker_hub_upload branch June 28, 2022 11:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants