24 lines
595 B
Bash
Executable File
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
|