From ee3969cfbb0e43a04f7e5163e75cb03694a9c40b Mon Sep 17 00:00:00 2001 From: Mikhail Date: Thu, 25 Jan 2024 23:12:21 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fddd17..3fbce3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,41 +1,24 @@ include: - project: "devops/pena-continuous-integration" file: "/templates/docker/build-template.gitlab-ci.yml" - - project: "devops/pena-continuous-integration" - file: "/templates/docker/clean-template.gitlab-ci.yml" - project: "devops/pena-continuous-integration" file: "/templates/docker/deploy-template.gitlab-ci.yml" stages: - - clean - build - deploy -clear-old-images: - extends: .clean_template - variables: - STAGING_BRANCH: "main" - PRODUCTION_BRANCH: "main" - image: - name: docker/compose:1.28.0 - entrypoint: [""] - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker images - script: - - docker system prune -af build-app: + tags: + - frontbuild extends: .build_template variables: DOCKER_BUILD_PATH: "./Dockerfile" - STAGING_BRANCH: "main" + STAGING_BRANCH: "staging" PRODUCTION_BRANCH: "main" - script: - - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID $CI_PROJECT_DIR - - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID deploy-to-staging: + tags: + - front + - staging extends: .deploy_template - variables: - DEPLOY_TO: "staging" - BRANCH: "main"