Commit 5615f52f authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'feat/deployment-strategy' into 'master'

feat(deploy): redesign deployment strategy

See merge request to-be-continuous/openshift!43
parents e2f90660 989340e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ Here are variables supported to configure the production environment:
| :lock: `OS_PROD_TOKEN`   | OpenShift API [token](#supported-authentication-methods) for `production` env  _(only define if different from default)_    | `$OS_TOKEN` |
| `OS_PROD_APP_NAME`       | Application name for `production` env  | `$OS_BASE_APP_NAME` |
| `OS_PROD_ENVIRONMENT_URL`| The production environment url _(only define for static environment URLs declaration and if different from default)_ | `$OS_ENVIRONMENT_URL` |
| `AUTODEPLOY_TO_PROD`     | Set this variable to auto-deploy to production. If not set deployment to production will be `manual` (default behaviour). | _none_ (disabled) |
| `OS_PROD_DEPLOY_STRATEGY`| Defines the deployment to production strategy. One of `manual` (i.e. _one-click_) or `auto`. | `manual` |


### `os-cleanup-all-review` job
+5 −3
Original line number Diff line number Diff line
@@ -181,9 +181,11 @@
          "advanced": true
        },
        {
          "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": "OS_PROD_DEPLOY_STRATEGY",
          "description": "Defines the deployment to production strategy.",
          "type": "enum",
          "values": ["manual", "auto"],
          "default": "manual"
        },
        {
          "name": "OS_PROD_URL",
+6 −7
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@ variables:
  OS_BASE_TEMPLATE_NAME: "openshift"
  OS_REVIEW_ENVIRONMENT_SCHEME: "https"
  OS_CLEANUP_OBJECT_TYPES: "all,pvc,configmap,secret"

  # default: one-click deploy
  OS_PROD_DEPLOY_STRATEGY: manual

  # default production ref name (pattern)
  PROD_REF: '/^(master|main)$/'
  # default integration ref name (pattern)
@@ -787,7 +791,6 @@ os-staging:
    # only on production branch(es), with $OS_STAGING_PROJECT set
    - if: '$OS_STAGING_PROJECT && $CI_COMMIT_REF_NAME =~ $PROD_REF'

# Deploy to production if on branch master and variable OS_PROD_PROJECT defined and AUTODEPLOY_TO_PROD is set
os-production:
  extends: .os-deploy
  stage: production
@@ -809,10 +812,6 @@ os-production:
    # exclude if $OS_PROD_PROJECT not set
    - if: '$OS_PROD_PROJECT == null || $OS_PROD_PROJECT == ""'
      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: $OS_PROD_PROJECT # useless test, just to prevent GitLab warning
    - if: '$OS_PROD_DEPLOY_STRATEGY == "manual"'
      when: manual
    - if: '$OS_PROD_DEPLOY_STRATEGY == "auto"'