with more involved deployment pipeline
This commit is contained in:
parent
36274c3155
commit
9cbaccc206
@ -10,5 +10,9 @@ scripts:
|
||||
type: shell
|
||||
run_release:
|
||||
type: shell
|
||||
start_deployment:
|
||||
type: shell
|
||||
render_templates:
|
||||
type: shell
|
||||
deploy_release:
|
||||
type: shell
|
||||
|
@ -2,24 +2,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "deploying docker image"
|
||||
echo "deploying image"
|
||||
deploymentrepo="$TMP/deployments"
|
||||
|
||||
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 "$TMP/docker-compose.deploy_release.yml.tmpl" \
|
||||
--dest "_deployments/$SERVICE/docker-compose.yml" \
|
||||
--extra-var "image=$tag"
|
||||
|
||||
cd _deployments
|
||||
cd $deploymentrepo
|
||||
|
||||
git add . && git commit -m "Added release $SERVICE: ${COMMIT_SHA:0:10}" && git pull && git push
|
||||
|
11
scripts/render_templates.sh
Executable file
11
scripts/render_templates.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
|
||||
deploymentrepo="$TMP/deployments"
|
||||
|
||||
CUDDLE_FETCH_POLICY=never cuddle_cli render_template \
|
||||
--template-file "$TMP/docker-compose.deploy_release.yml.tmpl" \
|
||||
--dest "$deploymentrepo/$SERVICE/docker-compose.yml" \
|
||||
--extra-var "image=$tag"
|
15
scripts/start_deployment.sh
Executable file
15
scripts/start_deployment.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "Starting deployment"
|
||||
|
||||
deploymentrepo="$TMP/deployments"
|
||||
|
||||
[ -d $deploymentrepo ] && rm -rf $deploymentrepo
|
||||
|
||||
git clone "$DEPLOYMENTS" $deploymentrepo
|
||||
[ ! -d $deploymentrepo ] && echo "deployments could not be cloned aborting" && exit 1
|
||||
|
||||
mkdir -p "$deploymentrepo/$SERVICE"
|
||||
|
Loading…
Reference in New Issue
Block a user