Skip to content

Commit

Permalink
[semver:minor] SDIT-1779: 🔧 Add env prefix to allow context to hold m…
Browse files Browse the repository at this point in the history
…ultiple projects
  • Loading branch information
petergphillips committed May 22, 2024
1 parent 2df34d9 commit da6b13d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/jobs/deploy_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parameters:
env:
type: string
default: dev
env_prefix:
type: string
default: ""
release_name:
type: string
default: PROJECT_NAME
Expand Down Expand Up @@ -75,6 +78,22 @@ parameters:
description: Required if jira_update is set, passed in as << pipeline.number >>
steps:
- checkout
- run:
name: Set kube env variables for << parameters.env >>
command: |
ENV_KUBE_ENV_NAME="<< parameters.env_prefix >>_KUBE_ENV_NAME"
if [[ -n "${!ENV_KUBE_ENV_NAME}" ]]; then
# We're good, so promote them up a level
ENV_KUBE_ENV_API="<< parameters.env_prefix >>_KUBE_ENV_API"
ENV_KUBE_ENV_CACERT="<< parameters.env_prefix >>_KUBE_ENV_CACERT"
ENV_KUBE_ENV_TOKEN="<< parameters.env_prefix >>_KUBE_ENV_TOKEN"
ENV_KUBE_ENV_NAMESPACE="<< parameters.env_prefix >>_KUBE_ENV_NAMESPACE"
echo "export KUBE_ENV_NAME=${!ENV_KUBE_ENV_NAME}" >> $BASH_ENV
echo "export KUBE_ENV_API=${!ENV_KUBE_ENV_API}" >> $BASH_ENV
echo "export KUBE_ENV_CACERT=${!ENV_KUBE_ENV_CACERT}" >> $BASH_ENV
echo "export KUBE_ENV_TOKEN=${!ENV_KUBE_ENV_TOKEN}" >> $BASH_ENV
echo "export KUBE_ENV_NAMESPACE=${!ENV_KUBE_ENV_NAMESPACE}" >> $BASH_ENV
fi
- k8s_setup
- install_helm
- install_aws_cli
Expand Down

0 comments on commit da6b13d

Please sign in to comment.