Commit 7f6e72ae authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat(publish): add HELM_PUBLISH_STRATEGY variable

parent b9ec2a19
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -407,6 +407,7 @@ This job publishes the packaged chart to a [chart repository](https://helm.sh/do
| :lock: `HELM_PUBLISH_PASSWORD`      | Helm registry password                       | `$CI_REGISTRY_PASSWORD` |
| `HELM_PUBLISH_URL`                  | The URL of the Helm repository to publish your Helm package.<br/>Supports both [chart repository](https://helm.sh/docs/topics/chart_repository/) or [OCI-based registry](https://helm.sh/docs/topics/registries/) (url must be prefixed with `oci://`) | `oci://$CI_REGISTRY/$CI_PROJECT_PATH/charts` ([GitLab's container registry](https://docs.gitlab.com/ee/user/packages/container_registry/)) |
| `HELM_PUBLISH_ON`                   | Defines on which branch(es) the publish job shall be enabled (`prod` to enable on production branch only, `protected` to enable on protected references and `all` to enable on all Git references) | `prod`                  |
| `HELM_PUBLISH_STRATEGY`             | Defines the publish strategy. One of `manual` (i.e. _one-click_), `auto` or `none` (disabled). | `manual` |
| `HELM_CM_PUSH_PLUGIN_VERSION`       | cm-push plugin version to install (only when using `push` method with a regular chart [repository](https://helm.sh/docs/topics/chart_repository/)) | _none_ (latest) |


+7 −0
Original line number Diff line number Diff line
@@ -217,6 +217,13 @@
          "default": "prod",
          "type": "enum",
          "values": ["prod", "protected", "all"]
        },
        {
          "name": "HELM_PUBLISH_STRATEGY",
          "description": "Defines the publish strategy.",
          "type": "enum",
          "values": ["none", "manual", "auto"],
          "default": "manual"
        },
            {
          "name": "HELM_CM_PUSH_PLUGIN_VERSION",
+5 −5
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ variables:
  # HELM_PUBLISH_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/release"
  # HELM_PUBLISH_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/release"
  HELM_PUBLISH_METHOD: "auto"
  HELM_PUBLISH_STRATEGY: "manual"
  
  HELM_REPOS: "stable@https://charts.helm.sh/stable bitnami@https://charts.bitnami.com/bitnami"

@@ -903,14 +904,13 @@ helm-publish:
      when: never
    - if: '$HELM_PUBLISH_ON == "protected" && $CI_COMMIT_REF_PROTECTED != "true"'
      when: never
    - if: $HELM_PROD_DEPLOY_STRATEGY == "auto"
    - if: '$HELM_PUBLISH_STRATEGY == "manual"'
      exists:
        - "**/Chart.yaml"
    # else: manual + blocking
    - if: $HELM_PROD_DEPLOY_STRATEGY == "manual"
      when: manual
    - if: '$HELM_PUBLISH_STRATEGY == "auto"'
      exists:
        - "**/Chart.yaml"
      when: manual

# Deploy job prototype
# Can be extended to define a concrete environment