From 58af0aab5e3fe7f1245145d970caf5e856805cba Mon Sep 17 00:00:00 2001 From: root Date: Wed, 3 Apr 2024 20:36:25 +0300 Subject: [PATCH] change ci pipline --- .gitlab-ci.yml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2e0211..4509243 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ stages: - build + - predeploy - deploy + - run build_backend: stage: build @@ -26,10 +28,42 @@ build_nginx: only: - ci-test01 +remove_old_containers: + stage: predeploy + tags: + - ci-test01 + script: docker rm --force `docker ps -qa` || true + only: + - ci-test01 + deploy_network: - stage: deploy + stage: predeploy tags: - ci-test01 script: docker network create app || true only: - ci-test01 + +deploy_backend: + stage: deploy + tags: + - ci-test01 + script: docker run -d --name notes-back --network app my_backend + only: + - ci-test01 + +deploy_frontend: + stage: deploy + tags: + - ci-test01 + script: docker run -d --name notes-app --network app my_frontend + only: + - ci-test01 + +deploy_nginx: + stage: run + tags: + - ci-test01 + script: docker run -d --name nginx --network app my_nginx + only: + - ci-test01