Update .gitlab-ci.yml file

This commit is contained in:
Aaron Riedel 2022-03-09 07:16:27 +00:00
parent 6c7aeafecf
commit 46e75415d4

View file

@ -24,6 +24,7 @@ docker-build-push:
fi
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
allow_failure: false
only:
- master
- dev
@ -37,6 +38,7 @@ docker-build:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
allow_failure: false
except:
- master
- dev
@ -47,17 +49,19 @@ container_scanning:
variables:
DOCKER_IMAGE: "$CI_REGISTRY_IMAGE${tag}"
stage: test
allow_failure: false
deploy_staging:
stage: deploy
image: debian
script:
before_script:
- apt-get update -qq
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- ssh $SSH_SERVER "cd /root && docker-compose pull shbot && docker-compose up -d shbot && exit"
only:
- master