-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🐛 octavia-cli: specific release job for octavia #11517
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
Conversation
merged in #11518 to get the release workflow working again on master branch |
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 made this comments before you changed some stuff so ¯_(ツ)_/¯
but looks great overall
pip install bumpversion | ||
bumpversion "$PART_TO_BUMP" | ||
|
||
NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) |
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.
nit: these grep lines can get scary as the env file changes in the future
NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) | |
# source and . are the same command | |
source .env | |
new_version=$VERSION |
by POSIX convention that is largely unfollowed ALL_CAPS variables are for use outside of the file, and lower case variables are for internal use... no one follows this though so ¯\(ツ)/¯
my suggestion will annoy set -u
as .env
has alot of unset things
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 can retrieve the new version from the bumpversion
execution, but I wanted to use the same grep that we use for PREV_VERSION
for consistency. Thanks for the suggestion! Do you think the grep regex should be more strict for safety?
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.
greps are fine, I've just been bitten in the past.
They are brittle to future changes and it's not usually clear when a break happens caused by changes to something like ENV variable naming
SUB_BUILD=PLATFORM ./gradlew publish | ||
VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push | ||
echo "Completed building and publishing..." | ||
source ./tools/bin/bump_version.sh |
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.
source
seems a little confusing here, are we simply intending to execute bump version, or is there something I am missing?
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'd like to make the NEW_VERSION
, PREV_VERSION
and GIT_REVISION
variable available in this script, these are defined in ./tools/bin/bump_version.sh
this why I sourced the script
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.
you will get those variables. However you will also execute all the code. I made a screenshot example. Just like most import
statements you get the variables and you execute the code
Shell in it's heart wants executables to be TINY so you can put them all together and do cool stuff. If you want half a script it's probably too large, break it up and call it from both places if it works better
Co-authored-by: Topher Lubaway <[email protected]>
Co-authored-by: Topher Lubaway <[email protected]>
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.
still approving
SUB_BUILD=PLATFORM ./gradlew publish | ||
VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push | ||
echo "Completed building and publishing..." | ||
source ./tools/bin/bump_version.sh |
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.
you will get those variables. However you will also execute all the code. I made a screenshot example. Just like most import
statements you get the variables and you execute the code
Shell in it's heart wants executables to be TINY so you can put them all together and do cool stuff. If you want half a script it's probably too large, break it up and call it from both places if it works better
pip install bumpversion | ||
bumpversion "$PART_TO_BUMP" | ||
|
||
NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) |
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.
greps are fine, I've just been bitten in the past.
They are brittle to future changes and it's not usually clear when a break happens caused by changes to something like ENV variable naming
What
The current release workflow does not work for Octavia because:
docker buildx
command to build multi-arch images, which is required for Octavia.How
1. Common
bump_version.sh
scriptI move the version bumping logic to a separate script which is re-used by the three jobs:
releaseAirbyte
job, called fromrelease_version.sh
releaseOctavia
job, called fromrelease_version_octavia.sh
createPullRequest
job, called from a dedicated stepThere is no harm in bumping three times in these three jobs because they all check out the same branch and only the
createPullRequest
job commits the changes. Other jobs require version bumping to tag the images after build.2. Specific Octavia release job
ubuntu-latest
runner, on whichdocker buildx
is availablerelease_version_octavia.sh
which is bumping, building and publishing octavia3. Create a final job to open the bump PR
This job runs after
releaseAirbyte
andreleaseOctavia
:It works 🎉
https://github.com/airbytehq/airbyte/pull/11587/files
The docker images were also successfully pushed to the DockerHub for Octavia, but I deleted the tags.
Did not run the platform build and publish yet, for safety mainly 😄
🚨User impact
The usual release process should not be impacted.