Last active
December 9, 2015 09:59
-
-
Save x-cray/b6df3a9beb5703483876 to your computer and use it in GitHub Desktop.
Generates versioned Marathon app definition JSON files
This file contains hidden or 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
#!/bin/bash | |
set -e | |
VERSION="$CI_BRANCH-$CI_COMMIT-$CI_BUILD_NUMBER" | |
declare -A TARGETS=( | |
[test-server]="." | |
) | |
# Set version in service.json | |
for i in "${!TARGETS[@]}" | |
do | |
SERVICE=${TARGETS[$i]}/service.json | |
TARGET=service-defs/${TARGETS[$i]} | |
mkdir -p $TARGET | |
echo "Setting version $VERSION for $SERVICE" | |
sed "s/\$tag/$VERSION/g" $SERVICE > $TARGET/service-$CI_BRANCH.json | |
cp $TARGET/service-$CI_BRANCH.json $TARGET/service-$VERSION.json | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment