Commit 3ba1ac0c authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Add artifact with template of environment used

parent b5fa652d
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -276,6 +276,7 @@ deploy_ocf_staging:
        echo "Generate env file for helm scripts"

        cat <<EOF > helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env.template
      # --------------------------------------------------------------------------------------------------------------
      # This file is generated by the GitLab CI pipeline for deploying CAPIF to the staging environment. 
      # It contains environment variables that are used in the deployment process. 
      # The values of these variables are set based on the current GitLab CI environment and the configuration 
@@ -334,13 +335,21 @@ deploy_ocf_staging:

      # Step 5: OpenCAPIF Register configuration
      # Only Common configuration of env apply to both mongo express components. REGISTER_HOSTNAME

      # --------------------------------------------------------------------------------------------------------------
      EOF
        sed -e "s/^[ ]*export VAULT_ACCESS_TOKEN=.*/export VAULT_ACCESS_TOKEN=$VAULT_ACCESS_TOKEN/" \
        helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env.template > helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env
        ./helm/scripts/install_capif.sh $NAMESPACE_DEV_TO_STAGING-mr
      fi

  artifacts:
    name: "$NAMESPACE_DEV_TO_STAGING-mr.template"
    paths:
      - helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env.template
    expire_in: 1 day
    when: always


delete_ocf_staging:
  stage: delete_ocf_staging
  needs:
@@ -360,6 +369,7 @@ delete_ocf_staging:
        else
          echo "### No helm capif directory and no env file found for $NAMESPACE_DEV_TO_STAGING-mr, create file ###"
          cat <<EOF > helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env.template
      # --------------------------------------------------------------------------------------------------------------
      # This file is generated by the GitLab CI pipeline for deploying CAPIF to the staging environment. 
      # It contains environment variables that are used in the deployment process. 
      # The values of these variables are set based on the current GitLab CI environment and the configuration 
@@ -418,7 +428,7 @@ delete_ocf_staging:

      # Step 5: OpenCAPIF Register configuration
      # Only Common configuration of env apply to both mongo express components. REGISTER_HOSTNAME

      # --------------------------------------------------------------------------------------------------------------
      EOF
          sed -e "s/^[ ]*export VAULT_ACCESS_TOKEN=.*/export VAULT_ACCESS_TOKEN=$VAULT_ACCESS_TOKEN/" \
          helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env.template > helm/scripts/envs/$NAMESPACE_DEV_TO_STAGING-mr.env