cuddle-rust-service-plan/scripts/deploy_release.sh
2022-08-14 20:12:22 +02:00

24 lines
595 B
Bash
Executable File

#!/bin/bash
set -e
echo "deploying docker image"
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
echo "pulling deployments repo"
git clone "$DEPLOYMENTS" _deployments
[ ! -d _deployments ] && echo "deployments could not be cloned aborting" && exit 1
mkdir -p "_deployments/$SERVICE"
CUDDLE_FETCH_POLICY=never cuddle_cli render_template \
--template-file docker-compose.deploy_release.yml.tmpl \
--dest "_deployments/$SERVICE/docker-compose.yml" \
--extra-var "image=$tag"
cd _deployments
git add . && git commit -m "Added release $SERVICE: ${COMMIT_SHA:0:10}" && git pull && git push