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