Open Ask AI (⌘/Ctrl+I)

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:

  1. Create a new cluster (if needed). Otherwise, use an existing cluster.
  2. On your desired cluster, create a Kubernetes namespace with your temporary environment name.
  3. Add the environment to your .gitlab-ci.yml file so it is part of your pipeline.
  4. Make sure you add the environment to your values.yml file.

.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.