Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleCI pushes releases to dockerhub based on tags and branches #1694

Merged
merged 5 commits into from
Sep 24, 2019

Conversation

dimroc
Copy link
Contributor

@dimroc dimroc commented Sep 19, 2019

https://www.pivotaltracker.com/n/projects/2235105/stories/168396064

image

Key features are the support for git tags.

  1. The following builds and releases a version on master.

Chainlink Core only:

git tag v0.0.2
git push origin v0.0.2

Explorer only:

git tag explorer-v0.0.2
git push origin explorer-v0.0.2
  1. Develop branch will update images with the tag developer

  2. Release candidates will be built when pushing to a branch like release/0.0.2, resulting in an image smartcontract/chainlink:candidate-0.0.2 and smartcontract/explorer:candidate-0.0.2.

  3. What isn't in this final PR, but we could readd, is an escape hatch for testing and debugging. I allowed chores-v.* to be built via tags in order for me to have confidence in the PR. If @thodges-gh you see a need for something like this, let me know.

@dimroc dimroc changed the title push to dockerhub based also on tags: Push releases to dockerhub based tags Sep 19, 2019
@dimroc dimroc force-pushed the chores/explorer-tags-for-dockerhub branch 7 times, most recently from 009a073 to 5a2b32d Compare September 20, 2019 14:07
@dimroc dimroc changed the title Push releases to dockerhub based tags Push releases to dockerhub based on tags Sep 20, 2019
@dimroc dimroc changed the title Push releases to dockerhub based on tags CircleCI pushes releases to dockerhub based on tags and branches Sep 20, 2019
@dimroc dimroc force-pushed the chores/explorer-tags-for-dockerhub branch 2 times, most recently from 68d04cb to 9232b0f Compare September 20, 2019 23:16
@dimroc
Copy link
Contributor Author

dimroc commented Sep 23, 2019

Successfully builds on tags

image

@dimroc dimroc force-pushed the chores/explorer-tags-for-dockerhub branch from 06bbf3f to e9be3ce Compare September 23, 2019 14:32
@@ -0,0 +1,45 @@
#!/bin/bash

set -ex
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deliberately left as set -ex to have insight on CI.

@dimroc dimroc marked this pull request as ready for review September 23, 2019 14:34
PROJECT_ROOT=`git rev-parse --show-toplevel`
pushd $PROJECT_ROOT >/dev/null

tools/bin/circleci_validate_if_versioned $circle_branch $circle_tag
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe surround the bash environment variables with "quotation marks"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have other instances in the same file where we confidently don't surround with quotation marks, like the pushd above. I'm going to leave this as is for now.

# if version tagged, but not master, error. Only master can have versions.
if [ "$circle_branch" != "master" ] && [ -n "$circle_tag" ]
then
echo Not on master \(${circle_branch}\) with git tag version \(${circle_tag}\), erroring.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe quotations?

if [ -z "$1" ]
then
exit 0 # No tag, skip.
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

if [ -z "$1" ]; then ?

.circleci/config.yml Outdated Show resolved Hide resolved
elif [[ "${branch}" =~ ^release\/([a-zA-Z0-9.]+) ]]; then
echo "${BASH_REMATCH[1]}"
echo "candidate-${BASH_REMATCH[1]}"
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@felder-cl
Copy link
Contributor

looks good as far as I can tell 👍

@dimroc dimroc force-pushed the chores/explorer-tags-for-dockerhub branch from f5596d9 to b987a2b Compare September 24, 2019 14:22
@dimroc dimroc merged commit 3ade39e into develop Sep 24, 2019
@dimroc dimroc deleted the chores/explorer-tags-for-dockerhub branch September 24, 2019 23:41
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.

None yet

3 participants