Feature environments
If your DX Cloud project requires different environments than the default three (dev, uat, prod), you can configure your .gitlab-ci.yml file for additional environments.
A typical use case is a temporary feature environment where you validate a change before it reaches uat and prod. Reflect those environment names in .gitlab-ci.yml.
Instructions
To create a feature environment:
- Create a new cluster (if needed). Otherwise, use an existing cluster.
- On your desired cluster, create a Kubernetes namespace with your temporary environment name.
- Add the environment to your
.gitlab-ci.ymlfile so it is part of your pipeline. - Make sure you add the environment to your
values.ymlfile.
.gitlab-ci.yml
...
deploy-FEATURE:
extends: .deploy
script:
- export DEPLOYMENT=FEATURE <1>
- export LE_ENVIRONMENT=letsencrypt-prod
- cat values.yml | gomplate > ${DEPLOYMENT}.yml
- cat ${DEPLOYMENT}.yml
- helm upgrade -i ${DEPLOYMENT} mironet/magnolia-helm --version ${HELM_CHART_VERSION} -f ${DEPLOYMENT}.yml --create-namespace -n ${DEPLOYMENT}
environment:
name: dev
when: manual
...
Specify the name of the environment in the DEPLOYMENT property.