From 50bb157dc997f76f32f61803ea824ee8d03d541b Mon Sep 17 00:00:00 2001 From: Johannes Zumthurm <nimro27@gmx.net> Date: Sat, 16 Nov 2024 20:49:50 +0100 Subject: [PATCH] add build and deploy --- .gitlab-ci.yml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2506af3..337f478 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ stages: - test - # - build - # - deploy + - build + - deploy test: stage: test @@ -16,4 +16,30 @@ test: - tox artifacts: paths: - - ./coverage.xml \ No newline at end of file + - ./coverage.xml + +build_master: + stage: build + image: docker:latest + before_script: + - echo "$CI_DOCKER_REGISTRY_TOKEN" | docker login -u "$CI_DOCKER_REGISTRY_USER" --password-stdin + script: + - docker build --pull -t "$CI_REGISTRY_IMAGE" ./ + - docker push "$CI_REGISTRY_IMAGE" + only: + - master + +build_dev: + stage: build + image: docker:stable + before_script: + - echo "$CI_DOCKER_REGISTRY_TOKEN_DEV" | docker login -u "$CI_DOCKER_REGISTRY_USER_DEV" --password-stdin + script: + - docker build --pull -t "$CI_REGISTRY_IMAGE_DEV" ./ + - docker push "$CI_REGISTRY_IMAGE_DEV" + +deploy: + stage: deploy + image: amiveth/ansible-ci-helper + script: + - python /main.py -- GitLab