-
Notifications
You must be signed in to change notification settings - Fork 357
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
ci: add docker image build to release workflow #266
Conversation
I removed the ghcr.io repo. I ran into some issues with 403 Forbidden errors when attempting to push to it in my own account. Unsure if this is related. Either way, it is quite straight forward to add ghcr.io as another registry when the time comes. |
I have QA'd this in a local fork with my own Dockerhub account: https://hub.docker.com/r/kholmescarmalink/datree/tags |
Hi @kevholmes Currently the expected The part which determines which release candidate should be used for the next release is located in if test -z "$RELEASE_CANDIDATE_VERSION"; then
latestRcTag=$(git tag --sort=-version:refname | grep "\-rc$" | head -n 1)
else
latestRcTag="$RELEASE_CANDIDATE_VERSION"
fi
if test -z "$latestRcTag"; then
echo "couldn't find latestRcTag"
exit 1
fi
echo $latestRcTag
git checkout $latestRcTag
release_tag=${latestRcTag%-rc} As you can see, this part is expecting to receive this WDYT? If you agree, I can add this step myself so you could rebase your branch to my changes or you can implement it yourself, whatever you prefer :) |
@myishay ty for the details! Do you want release candidate builds get pushed out to Dockerhub? I could see how maybe it would be ideal to push the I think it makes sense to split some of I am ok with you pushing changes in this PR to address that so we can confer and come up with the best solution. |
@kevholmes ty for your contribution :) For now I think it will be fine only pushing production builds to dockerhub, but it could be nice adding release candidates to the dockerhub repository in the future. I'm working now on adding a step that will define the release version and will be used both by travis strp and release-docker step |
@kevholmes I've added the pre-step in the release workflow so release-docker step will use it as well as travis step. |
.github/workflows/release.yml
Outdated
push: true | ||
tags: | | ||
${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:latest | ||
${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ steps.define_version.outputs.version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this call to a Step output fill fail since that is scoped to the release
Job. I believe we would need to create an output var for the release
Job itself and set it equal to our Step's output like:
release:
outputs:
version: ${{ steps.define_version.outputs.version }}
Then within the release-docker
Job we'd use
${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ needs.release.outputs.version }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevholmes You are totally right, I missed this one..!
Working on a fix now
b061a0a
to
6b8d6e6
Compare
@kevholmes I have added an extra job that will be used by any other jobs if needed, lmk what you think 🔍 |
TY @myishay! I made a couple small edits but I think we're looking great. I tried to run this in my fork to test but it seems like Actions is having an issue right now as none of the jobs are actually kicking off... |
@kevholmes Thanks for the changes! |
@myishay Looks like Actions is back - I tried running this in my fork and saw some unusual behavior. My first question is what does valid input look like in regards to what a user is going to put into the My hunch is that our And we are getting the I noticed this because when
My suggestion would be to try something like this in run: |-
OUTPUT_VERSION=$(bash scripts/define_release_version.sh ${{ github.event.inputs.release_candidate_version }})
echo "detected version = $OUTPUT_VERSION"
echo ::set-output name=version::$(echo $OUTPUT_VERSION) Ultimately the issue is that we're seeing a failure that should be detected but for whatever reason it's not due to how GitHub is handling ::set-output and what happens in those inner braces where the shell script is executed. Here's the example run of this uncaught error happening in my repo: https://github.com/kevholmes/datree/actions/runs/1423126433 |
@kevholmes Thanks for the detailed explanation! Answering your first question, a valid input for So, as you said I made a few tests on my side and it seems like you are right. I beleive your suggested changes to |
Ty for the details @myishay, so I updated my workflow test with the updated error handling I mentioned above, and ran the workflow with an incorrect string In my next test: https://github.com/kevholmes/datree/runs/4117271802 I used the valid string |
…d' into ci/add_docker_image_build
@kevholmes Actually this is by design. |
Ahhh! Cool ok. This seems to satisfy the requirements then. I think we are ready to merge? |
Yes we are 😄 |
This resolves #250.
I have updated the manually triggered
release.yml
workflow. This workflow could be automatically triggered by another event such as cutting the release itself in GitHub if the team is interested in that as confidence in the build system grows and more automation makes sense.Another suggestion I have is that for the earlier workflow Job speaking to Travis that's called
release
. We can validate the entered release tag with a regex to make sure the Action doesn't kick off if there's a typo in that user-provided string to avoid pushing builds with incorrect version tags. A basic semver check.Those could be other issues with their own PRs - just some thoughts I had after looking at this.