Skip to content

Introduce DockerHub build trigger#183

Merged
hanefi merged 2 commits intomasterfrom
update-ci-jobs
Apr 6, 2020
Merged

Introduce DockerHub build trigger#183
hanefi merged 2 commits intomasterfrom
update-ci-jobs

Conversation

@hanefi
Copy link
Copy Markdown
Member

@hanefi hanefi commented Apr 6, 2020

We have several rules on Docker Hub that gets triggered on branch and tag pushes. However we do not have a mechanism to update images nightly. This PR aims to do the following:

  • Introduce nightly image creation in test steps
  • Provide clear and understandable names that help improve CI interface
  • Create a mechanism to update the docker images every day

Proposed CI workflow:

  • Run 3 jobs in parallel, create latest, alpine and nightly images
  • Trigger Docker Hub builds only when:
    • on master branch
    • all the images were successfully built

Comment thread .travis.yml
- name: trigger-dockerhub
if: branch = master AND type != pull_request
env:
- DOCKERFILE=Dockerfile
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why I removed the env fields here:

  1. The trigger-dockerhub stage should happen only once, not 3 times
  2. It is not so easy to provide name fields, when we have a matrix (If name field is provided they significantly improve CI interface)

@hanefi hanefi requested review from JelteF and onurctirtir April 6, 2020 12:48
Comment thread .travis.yml
stages:
- build-image
- name: trigger-dockerhub
if: branch = master AND type != pull_request
Copy link
Copy Markdown
Member Author

@hanefi hanefi Apr 6, 2020

Choose a reason for hiding this comment

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

CI docs state that branch variable stores current branch name; However for pull requests: the base branch name.

We should trigger builds only in two cases:

  1. A PR gets merged into master
  2. A Cron Job triggers the CI build on master

Copy link
Copy Markdown
Contributor

@JelteF JelteF left a comment

Choose a reason for hiding this comment

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

LGTM, assuming you did some testing of this.

@hanefi
Copy link
Copy Markdown
Member Author

hanefi commented Apr 6, 2020

LGTM, assuming you did some testing of this.

Yes, I did. I monitored recent builds on docker hub, and observed that we can build new images there.

@hanefi hanefi merged commit 0eb397c into master Apr 6, 2020
@hanefi hanefi deleted the update-ci-jobs branch April 6, 2020 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants