Add setup steps to pipeline (network, .env, git pull)
This commit is contained in:
@@ -16,8 +16,8 @@ steps:
|
||||
image: docker:24-dind
|
||||
commands:
|
||||
- cd gen
|
||||
- docker build -t registry.mcrn.ar/soleprint:$${CI_COMMIT_SHA:0:7} .
|
||||
- docker tag registry.mcrn.ar/soleprint:$${CI_COMMIT_SHA:0:7} registry.mcrn.ar/soleprint:latest
|
||||
- docker build -t registry.mcrn.ar/soleprint:${CI_COMMIT_SHA::7} .
|
||||
- docker tag registry.mcrn.ar/soleprint:${CI_COMMIT_SHA::7} registry.mcrn.ar/soleprint:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
when:
|
||||
@@ -28,7 +28,7 @@ steps:
|
||||
push:
|
||||
image: docker:24-dind
|
||||
commands:
|
||||
- docker push registry.mcrn.ar/soleprint:$${CI_COMMIT_SHA:0:7}
|
||||
- docker push registry.mcrn.ar/soleprint:${CI_COMMIT_SHA::7}
|
||||
- docker push registry.mcrn.ar/soleprint:latest
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
@@ -45,7 +45,14 @@ steps:
|
||||
key:
|
||||
from_secret: deploy_key
|
||||
script:
|
||||
- docker network create mainroom_default 2>/dev/null || true
|
||||
- cd ~/soleprint && git pull origin main
|
||||
- cd ~/soleprint/gen
|
||||
- |
|
||||
if [ ! -f .env ]; then
|
||||
echo "DEPLOYMENT_NAME=soleprint" > .env
|
||||
echo "SOLEPRINT_PORT=12000" >> .env
|
||||
fi
|
||||
- docker pull registry.mcrn.ar/soleprint:latest
|
||||
- docker compose down || true
|
||||
- docker compose up -d
|
||||
|
||||
Reference in New Issue
Block a user