From 9513b98f418d0ea6c3ba037a8a63a623b6f3f02d Mon Sep 17 00:00:00 2001
From: andresanaya21 <alvaroandres.anayaamariles@telefonica.com>
Date: Mon, 27 May 2024 12:58:53 +0200
Subject: [PATCH] staging_post_mr

---
 capif/templates/cd-deploy-ocf.gitlab-ci.yml | 3 ++-
 capif/templates/ci_staging.gitlab-ci.yml    | 8 ++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/capif/templates/cd-deploy-ocf.gitlab-ci.yml b/capif/templates/cd-deploy-ocf.gitlab-ci.yml
index 66bb812..52f56bf 100644
--- a/capif/templates/cd-deploy-ocf.gitlab-ci.yml
+++ b/capif/templates/cd-deploy-ocf.gitlab-ci.yml
@@ -33,6 +33,7 @@ variables:
     - shell
   rules:
     - if: '$CI_COMMIT_REF_NAME == "staging"'
+      when: always
 
 .dev_common: &dev_common
   tags:
@@ -119,7 +120,7 @@ deploy_ocf_oficial_staging:
   stage: deploy_ocf_oficial_staging
   needs:
     - staging_build_and_push_mr
-  <<: *staging_common
+  <<: *staging_post_mr
   environment:
     name: review/oficial-staging
     url: https://capif-staging.$DOMAIN_STAGING
diff --git a/capif/templates/ci_staging.gitlab-ci.yml b/capif/templates/ci_staging.gitlab-ci.yml
index c4f69dc..e59f13f 100644
--- a/capif/templates/ci_staging.gitlab-ci.yml
+++ b/capif/templates/ci_staging.gitlab-ci.yml
@@ -19,12 +19,14 @@ variables:
 .staging_common: &staging_common
   rules:
     - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "staging"'
+      when: always
   tags:
     - shell
 
 .staging_mr: &staging_mr
   rules:
     - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "staging"'
+      when: always
   tags:
     - shell
 
@@ -40,12 +42,6 @@ variables:
   tags:
     - docker-in-docker
 
-#staging_pulling_repo:
-#  stage: staging_pulling_repo
-#  script:
-#    - git clone https://oauth2:${CI_JOB_TOKEN}@labs.etsi.org/rep/ocf/capif.git
-#  <<: *staging_common
-
 #staging_cancel_previous_action:
 #  stage: staging_pre_pipeline
 #  script:
-- 
GitLab