26 lines
639 B
Bash
Executable File
26 lines
639 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "deploying docker image"
|
|
|
|
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
|
|
|
|
echo "pulling deployments repo"
|
|
|
|
[ -d _deployments ] && rm -rf _deployments
|
|
|
|
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
|