-
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
Changes from 28 commits
bb938fe
fb85af0
f940207
88120ec
80fb22f
7d81669
b409a5b
f56b478
2c2fabc
2ebc4e3
43f347a
bf04b8e
7741b77
6beccda
63b2d0c
426987a
f015272
1283821
e1f4664
edd8357
749a2a0
633d80a
4b11f1e
14e0e2a
eabec42
6218f67
a8c0be0
28629ff
4661a36
a8feb00
afd97ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
PREV_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) | ||
GIT_REVISION=$(git rev-parse HEAD) | ||
|
||
pip install bumpversion | ||
bumpversion "$PART_TO_BUMP" | ||
|
||
NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) | ||
|
||
echo "Bumped version from ${PREV_VERSION} to ${NEW_VERSION}" | ||
echo ::set-output name=PREV_VERSION::${PREV_VERSION} | ||
echo ::set-output name=NEW_VERSION::${NEW_VERSION} | ||
echo ::set-output name=GIT_REVISION::${GIT_REVISION} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,24 +21,11 @@ fi | |
|
||
docker login -u airbytebot -p "${DOCKER_PASSWORD}" | ||
|
||
PREV_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) | ||
|
||
[[ -z "$PART_TO_BUMP" ]] && echo "Usage ./tools/bin/release_version.sh (major|minor|patch)" && exit 1 | ||
|
||
# uses .bumpversion.cfg to find files to bump | ||
# requires no git diffs to run | ||
# commits the bumped versions code to your branch | ||
pip install bumpversion | ||
bumpversion "$PART_TO_BUMP" | ||
|
||
NEW_VERSION=$(grep -w VERSION .env | cut -d"=" -f2) | ||
GIT_REVISION=$(git rev-parse HEAD) | ||
[[ -z "$GIT_REVISION" ]] && echo "Couldn't get the git revision..." && exit 1 | ||
|
||
echo "Bumped version from ${PREV_VERSION} to ${NEW_VERSION}" | ||
echo "Building and publishing version $NEW_VERSION for git revision $GIT_REVISION..." | ||
|
||
VERSION=$NEW_VERSION SUB_BUILD=PLATFORM ./gradlew clean build | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to make the There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 |
||
|
||
# TESTING: DISABLE BUILD AND PUBLISH FOR ITERATIONS ON CI | ||
# echo "Building and publishing PLATFORM version $NEW_VERSION for git revision $GIT_REVISION..." | ||
# VERSION=$NEW_VERSION SUB_BUILD=PLATFORM ./gradlew clean build | ||
# 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 PLATFORM..." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
. tools/lib/lib.sh | ||
|
||
if [[ -z "${DOCKER_PASSWORD}" ]]; then | ||
alafanechere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo 'DOCKER_PASSWORD for airbytebot not set.'; | ||
exit 1; | ||
fi | ||
|
||
docker login -u airbytebot -p "${DOCKER_PASSWORD}" | ||
alafanechere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
source ./tools/bin/bump_version.sh | ||
|
||
echo "Building and publishing OCTAVIA version ${NEW_VERSION} for git revision ${GIT_REVISION}..." | ||
VERSION=$NEW_VERSION SUB_BUILD=OCTAVIA_CLI ./gradlew clean build | ||
./octavia-cli/publish.sh ${NEW_VERSION} ${GIT_REVISION} | ||
echo "Completed building and publishing OCTAVIA..." |
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
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 thingsThere 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 forPREV_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