radiator-web/.gitlab-ci.yml
garionion 160ed424ae
Some checks reported errors
continuous-integration/drone/push Build encountered an error
fix formatting
2021-04-08 14:27:52 +02:00

53 lines
1.2 KiB
YAML

stages:
- build
- deploy
variables:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
ANSIBLE_PYTHON_INTERPRETER: auto_silent
ANSIBLE_STDOUT_CALLBACK: debug
docker-build-main:
# Official docker image.
image: docker:latest
stage: build
tags:
- docker
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
only:
- main
docker-build:
# Official docker image.
image: docker:latest
stage: build
tags:
- docker
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
except:
- main
deploy-main:
#when: manual
stage: deploy
image:
name: cytopia/ansible:latest-tools
entrypoint: [""]
script:
- chmod 600 "${ANSIBLE_SSH_KEY_PRIVATE}"
- ansible-playbook -i ./deployment/hosts.yml --private-key "${ANSIBLE_SSH_KEY_PRIVATE}" "./deployment/deployment.yml"
only:
- main