From bcd5e372699edcdf103c99431a275acc774bbcb0 Mon Sep 17 00:00:00 2001
From: Ravi Tripathi <ravi89@uab.edu>
Date: Mon, 28 Aug 2023 19:24:13 -0500
Subject: [PATCH] Adding TARGET_ENV as environments for different jobs

---
 .gitlab-ci.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ce90ed7..c2aece5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,6 +28,8 @@ stages:          # List of stages for jobs, and their order of execution
 prep-deploy:
   stage: .pre
   tags: [build]
+  environment:
+    name: $TARGET_ENV
   script:
     - export BUILD_DATE=$(TZ=America/Chicago date +%Y-%m-%d-%H-%M-%S)
     - |
@@ -55,6 +57,8 @@ prep-deploy:
 tf-validate:
   stage: validate
   tags: [build]
+  environment:
+    name: $TARGET_ENV
   script:
     - cd CRI_XCBC && git checkout dev && cd ..
     - terraform --version
@@ -70,6 +74,8 @@ tf-apply:
       - .terraform/
   stage: build
   tags: [build]
+  environment:
+    name: $TARGET_ENV
   script:
     - echo "TF_VAR_data_volume=${TF_VAR_data_volume}"
     - echo "TF_VAR_flavor=${TF_VAR_flavor}"
@@ -132,6 +138,8 @@ staging-post-deploy:
 clean-up:
   stage: cleanup
   tags: [build]
+  environment:
+    name: $TARGET_ENV
   script:
     - terraform destroy -auto-approve
   when: manual
-- 
GitLab