Commit 320f7bcd 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 $S3_PROD_DEPLOY_STRATEGY - see doc)
parent 248a774c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ Here are variables supported to configure the production environment:
| :lock: `S3_PROD_ACCESS_KEY` | S3 service Access Key for `production` env  _(only define if different from default)_    | `$S3_ACCESS_KEY` |
| :lock: `S3_PROD_SECRET_KEY` | S3 service Secret Key for `production` env  _(only define if different from default)_    | `$S3_SECRET_KEY` |
| `S3_PROD_BUCKET_NAME`    | Bucket name for `production` env  | `$S3_BASE_BUCKET_NAME` |
| `AUTODEPLOY_TO_PROD`     | Set this variable to auto-deploy to production. If not set deployment to production will be `manual` (default behaviour). | _none_ (disabled) |
| `S3_PROD_DEPLOY_STRATEGY`| Defines the deployment to production strategy. One of `manual` (i.e. _one-click_) or `auto`. | `manual` |
| `S3_PROD_PREFIX`  |  S3 prefix to use for `production` env _(only define if different from default)_ | `S3_PREFIX` |

### Buckets namespacing
+5 −3
Original line number Diff line number Diff line
@@ -230,9 +230,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": "S3_PROD_DEPLOY_STRATEGY",
          "description": "Defines the deployment to production strategy.",
          "type": "enum",
          "values": ["manual", "auto"],
          "default": "manual"
        },
        {
          "name": "S3_PROD_PREFIX",
+6 −8
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ variables:
  # defaults to AWS
  S3_WEBSITE_ENDPOINT: "http://%(bucket)s.s3-website.%(location)s.amazonaws.com"

  # default: one-click deploy
  S3_PROD_DEPLOY_STRATEGY: manual

  # default production ref name (pattern)
  PROD_REF: '/^(master|main)$/'
  # default integration ref name (pattern)
@@ -639,8 +642,7 @@ s3-staging:
    # only on production branch(es)
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF'

# deploy to production env (for 'master' branch by default; only after acceptance tests)
# $AUTODEPLOY_TO_PROD controls whether your are continuous deployment (auto deployment to prod) or continuous delivery (manual deployment to prod)
# deploy to production env
s3-production:
  extends: .s3-deploy
  stage: production
@@ -663,10 +665,6 @@ s3-production:
    # exclude if $S3_PROD_DISABLED set
    - if: '$S3_PROD_DISABLED == "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: '$S3_PROD_DEPLOY_STRATEGY == "manual"'
      when: manual
    - if: '$S3_PROD_DEPLOY_STRATEGY == "auto"'