add deployment
This commit is contained in:
parent
2f69fc5422
commit
280a9786ec
@ -9,3 +9,5 @@ scripts:
|
||||
type: shell
|
||||
run_release:
|
||||
type: shell
|
||||
deploy_release:
|
||||
type: shell
|
||||
|
21
scripts/deploy_release.sh
Executable file
21
scripts/deploy_release.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "deploying docker image"
|
||||
|
||||
tag="$REGISTRY/$SERVICE:${COMMIT_SHA:0:10}"
|
||||
|
||||
echo "pulling deployments repo"
|
||||
|
||||
[ ! -d _deployments ] && echo "deployments could not be cloned aborting" && exit 1
|
||||
|
||||
git clone "$DEPLOYMENTS" _deployments
|
||||
|
||||
mkdir -p "_deployments/$SERVICE"
|
||||
|
||||
cp "$TMP/docker-compose.deploy_release.yml" "_deployments/$SERVICE/docker-compose.yml"
|
||||
|
||||
cd _deployments
|
||||
|
||||
git add . && git commit -m "Added release $SERVICE: ${COMMIT_SHA:0:10}" && git pull && git push
|
17
templates/docker-compose.deploy_release.yml
Normal file
17
templates/docker-compose.deploy_release.yml
Normal file
@ -0,0 +1,17 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
{{.service}}:
|
||||
image: {{.image}}
|
||||
ports:
|
||||
- {{.ports}}
|
||||
env_file: ".env"
|
||||
restart: always
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: postgres:13.5
|
||||
restart: always
|
||||
env_file: ".env"
|
||||
volumes:
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
Loading…
Reference in New Issue
Block a user