Commit b9ec2a19 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat(deploy): redesign deployment strategy

BREAKING CHANGE: $AUTODEPLOY_TO_PROD no longer supported (replaced by $HELM_PROD_DEPLOY_STRATEGY - see doc)
parent e71325c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ Here are variables supported to configure the production environment:
| `HELM_PROD_ENVIRONMENT_URL`| The production environment url _(only define for static environment URLs declaration and if different from default)_ | `$HELM_ENVIRONMENT_URL` |
| `HELM_PROD_NAMESPACE`    | The Kubernetes namespace to use for `production` env _(only define to override default)_ | `$KUBE_NAMESPACE` |
| :lock: `HELM_PROD_KUBE_CONFIG` | Specific kubeconfig for `production` env _(only define to override default)_ | `$HELM_DEFAULT_KUBE_CONFIG` |
| `AUTODEPLOY_TO_PROD`     | Set this variable to auto-deploy to production. If not set deployment to production will be `manual` (default behaviour). | _none_ (disabled) |
| `HELM_PROD_DEPLOY_STRATEGY`| Defines the deployment to production strategy. One of `manual` (i.e. _one-click_) or `auto`. | `manual` |
| `HELM_PROD_VALUES`       | The [Values file](https://helm.sh/docs/chart_template_guide/values_files/) to use with the production environment | _none_ |

### `helm-lint` job
+5 −3
Original line number Diff line number Diff line
@@ -343,9 +343,11 @@
      "enable_with": "HELM_PROD_ENABLED",
      "variables": [
        {
          "name": "AUTODEPLOY_TO_PROD",
          "type": "boolean",
          "description": "Set this variable to auto-deploy to production. If not set deployment to production will be manual (default behaviour)."
          "name": "HELM_PROD_DEPLOY_STRATEGY",
          "description": "Defines the deployment to production strategy.",
          "type": "enum",
          "values": ["manual", "auto"],
          "default": "manual"
        },
        {
          "name": "HELM_PROD_APP_NAME",
+8 −8
Original line number Diff line number Diff line
@@ -109,6 +109,9 @@ variables:
  HELM_REVIEW_ENVIRONMENT_SCHEME: "https"
  HELM_PUBLISH_ON: "prod"

  # default: one-click deploy
  HELM_PROD_DEPLOY_STRATEGY: manual

  # default production ref name (pattern)
  PROD_REF: '/^(master|main)$/'
  # default integration ref name (pattern)
@@ -900,11 +903,12 @@ helm-publish:
      when: never
    - if: '$HELM_PUBLISH_ON == "protected" && $CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    - if: '$AUTODEPLOY_TO_PROD == "true"'
    - if: $HELM_PROD_DEPLOY_STRATEGY == "auto"
      exists:
        - "**/Chart.yaml"
    # else: manual + blocking
    - exists:
    - if: $HELM_PROD_DEPLOY_STRATEGY == "manual"
      exists:
        - "**/Chart.yaml"
      when: manual

@@ -1208,10 +1212,6 @@ helm-production:
    # exclude if $HELM_PROD_ENABLED not set
    - if: '$HELM_PROD_ENABLED != "true"'
      when: never
    # if $AUTODEPLOY_TO_PROD: auto
    - if: '$AUTODEPLOY_TO_PROD == "true"'
    # else if PUBLISH_ON_PROD enabled: auto (because the publish job was blocking)
    - if: '$PUBLISH_ON_PROD == "true"'
    # else: manual, blocking
    - if: $CI_COMMIT_REF_NAME # useless test, just to prevent GitLab warning
    - if: '$HELM_PROD_DEPLOY_STRATEGY == "manual"'
      when: manual
    - if: '$HELM_PROD_DEPLOY_STRATEGY == "auto"'