-
Notifications
You must be signed in to change notification settings - Fork 15
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
Release/1.4.0 alpha2 #226
Merged
Merged
Release/1.4.0 alpha2 #226
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remcowesterhoud
force-pushed
the
release/1.4.0-alpha2
branch
from
March 2, 2022 10:34
1c69ea2
to
941c6fd
Compare
@pihme I've fixed the workflow. I think this covers all cases.
|
pihme
approved these changes
Mar 2, 2022
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.
Looks good to me.
The only concern I have that in two months we will have forgotten how it works exactly. Maybe you could add some comments or documentation to explain the solution
In the "Update image and tag in Git" step we update the configuration file with the proper image name and tag. For workflows triggered by releases this part is done in HEADLESS mode. This means we cannot push these changes to a remote. In the deploy-to-maven job we did a new checkout of the code. In this code the changes we made in te "Update image and tag in Git" are not available. This causes the application to be packaged whilst pointing to the wrong image. By combining these 2 jobs into one we no longer do a 2nd checkout. As a result the application gets packaged with the correct configurations.
Adding this as a resources to maven and applying filtering allows maven to set the tag dynamically to the project.version. When we create a new release we will build a new image tagged with the release version. Maven will build the application with the release version. By syncing these 2 up the version should always match.
Maven overrides the image tag in the config with the project.version. This works fine for releases. Release X.Y.Z gets created, an image is built and pushed with tag X.Y.Z and maven updates the config to X.Y.Z and packages the application. The main branch is an exception here. The project.version in this case would be X.Y.Z-SNAPSHOT. We don't want to publish a lot of different SNAPSHOT versions on docker hub. For this reason we should override it with latest. The workflow would then be as follows: 1. A change is pushed to the main branch 2. Everything gets tested and verified 3. A docker image is built and pushed with the tag "latest" 4. We update the configuration to set the tag to "latest" 5. Maven doesn't replace any of configuration and packages it using "latest". If we don't add this step maven will replace the tag in the config to X.Y.Z-SNAPSHOT. This does not match the tag of the image we just built.
There is some logic and exceptions in surrounding the image tag. These comments aim to explain why these steps are required and why they do what they do.
remcowesterhoud
force-pushed
the
release/1.4.0-alpha2
branch
from
March 2, 2022 14:41
f8a60d7
to
6aac302
Compare
Automatic code formatting is causing more issues than it's worth at this moment. Instead we should fail the build if the checks don't pass and fix the issue manually.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Several fixes in the workflow to deal with the fact that git is in headless mode when checking out a release tag.
extension-testcontainer
config file.main
branch are still using thelatest
tag. This way we keep the same behaviour as we had previously.Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
Testing:
Documentation: