Feature environments
If your Magnolia PaaS project requires that you have different environments than the default 3 environments (dev, uat, prod), you can configure your .gitlab-ci.yml
file to have whatever environments you like.
A typical use-case for this would be temporary feature environments where you work on a new feature or improvement that you want to see fully before it goes into uat
and onto prod
. You can do this by ensuring your .gitlab-ci.yml
file is configured to reflect the name of those environments.
Once configured in the .gitlab-ci.yml file, you can easily view and manage your environments directly from the Cockpit.
|
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.yml
file to ensure it’s part of your pipeline. -
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
...
1 | Specify the name of the environment in the DEPLOYMENT property. |