Skip to content

Commit

Permalink
ci: update env var for runtime version (#530)
Browse files Browse the repository at this point in the history
* ci: update env var for runtime version

* Update bin/update-proxy-versions.sh

Co-authored-by: Enno Runne <[email protected]>

* safer version and update file name

* run from root folder

---------

Co-authored-by: Enno Runne <[email protected]>
  • Loading branch information
efgpinto and ennru authored Jan 3, 2024
1 parent 62c6a71 commit d7512a7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions bin/update-proxy-versions.sh → bin/update-runtime-versions.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
#!/usr/bin/env bash

# USAGE:
# > PROXY_VERSION=1.0.31 ./update-proxy-versions.sh
# > RUNTIME_VERSION=1.0.31 ./bin/update-proxy-versions.sh

# this script is meant to be used after a new Proxy version is out
# to facilitate the update of all the places where we usually depend on the latest version

# provide the new proxy version you want the project to be updated to
if [[ -z "$PROXY_VERSION" ]]; then
echo "Must provide PROXY_VERSION in environment" 1>&2
# provide the new Kalix Runtime version you want the project to be updated to
if [[ -z "${RUNTIME_VERSION}" ]]; then
echo "Must provide RUNTIME_VERSION in environment" 1>&2
exit 1
fi

cd ..

echo ">>> Updating docker image versions to $PROXY_VERSION"
echo ">>> Updating docker image versions to ${RUNTIME_VERSION}"
PROJS=$(find . -type f -name "docker-compose.yml")
for i in ${PROJS[@]}
do
echo "Updating Dockerfile for: $i"
sed -i.bak "s/gcr.io\/kalix-public\/kalix-runtime:\(.*\)/gcr.io\/kalix-public\/kalix-runtime:$PROXY_VERSION/" $i
sed -i.bak "s/gcr.io\/kalix-public\/kalix-runtime:\(.*\)/gcr.io\/kalix-public\/kalix-runtime:${RUNTIME_VERSION}/" $i
rm $i.bak
done

echo ">>> Updating application.conf"
sed -i.bak "s/gcr.io\/kalix-public\/kalix-runtime:\(.*\)\"/gcr.io\/kalix-public\/kalix-runtime:$PROXY_VERSION\"/" ./codegen/js-gen-cli/src/it/resources/application.conf
sed -i.bak "s/gcr.io\/kalix-public\/kalix-runtime:\(.*\)\"/gcr.io\/kalix-public\/kalix-runtime:${RUNTIME_VERSION}\"/" ./codegen/js-gen-cli/src/it/resources/application.conf
rm ./codegen/js-gen-cli/src/it/resources/application.conf.bak

echo ">>> Updating config.json"
sed -i.bak "s/\"frameworkVersion\": \"\(.*\)\"/\"frameworkVersion\": \"$PROXY_VERSION\"/" ./sdk/config.json
sed -i.bak "s/\"frameworkVersion\": \"\(.*\)\"/\"frameworkVersion\": \"${RUNTIME_VERSION}\"/" ./sdk/config.json
rm ./sdk/config.json.bak

0 comments on commit d7512a7

Please sign in to comment.