Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions contrib/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

set -e

BACKEND=''
FRONTEND=''
MOTIVA=''

while [ $# -gt 0 ]; do
case "$1" in
--backend) BACKEND="$2" ;;
--frontend) FRONTEND="$2" ;;
--motiva) MOTIVA="$2" ;;

*)
echo "Unknown option: $1" >&2
exit 1
esac

shift 2
done

[ -z "$BACKEND" ] && echo 'ERROR: backend version should be provided' && exit 1
[ -z "$FRONTEND" ] && echo 'ERROR: frontend version should be provided' && exit 1
Comment thread
apognu marked this conversation as resolved.

git -C api fetch
git -C api checkout "$BACKEND"
git -C front fetch
git -C front checkout "$FRONTEND"

export BACKEND FRONTEND MOTIVA

for FILE in docker-compose.yaml docker-compose-dev.yaml; do
yq -i '.x-backend-image-version.image = "europe-west1-docker.pkg.dev/marble-infra/marble/marble-backend:\(strenv(BACKEND))"' $FILE
yq -i '.x-frontend-image-version.image = "europe-west1-docker.pkg.dev/marble-infra/marble/marble-frontend:\(strenv(FRONTEND))"' $FILE

if [ -n "$MOTIVA" ]; then
yq -i '.services.motiva.image = "ghcr.io/apognu/motiva:\(strenv(MOTIVA))"' $FILE
fi
done