Commit 833f5498 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'breaking/autostop-review' into 'master'

feat!: support environment auto-stop

Closes #25

See merge request to-be-continuous/cloud-foundry!84
parents 863be5aa 9f8fa7ce
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -403,6 +403,7 @@ Here are variables supported to configure review environments:
| `review-push-args` / `CF_REVIEW_PUSH_ARGS`                   | Additional arguments for push command                                             | `$CF_DEFAULT_PUSH_ARGS`                                                            |
| `review-retired-app-suffix` / `CF_REVIEW_RETIRED_APP_SUFFIX` | If set, the app old version is not deleted/overriden but renamed with this suffix | _none_                                                                             |
| `review-domain-tmp` / `CF_REVIEW_DOMAIN_TMP`                 | The review environment domain for the temporary blue-green app                    | `$CF_REVIEW_DOMAIN`                                                                |
| `review-autostop-duration` / `CF_REVIEW_AUTOSTOP_DURATION`   | The amount of time before GitLab will automatically stop `review` environments    | `4 hours`                                                                          |

### Integration environment configuration

+5 −0
Original line number Diff line number Diff line
@@ -163,6 +163,11 @@
          "name": "CF_REVIEW_RETIRED_APP_SUFFIX",
          "description": "If set, the app old version is not deleted/overriden but renamed with this suffix",
          "advanced": true
        },
        {
          "name": "CF_REVIEW_AUTOSTOP_DURATION",
          "description": "The amount of time before GitLab will automatically stop `review` environments",
          "default": "4 hours"
        }
      ]
    },
+5 −0
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ spec:
    review-environment-domain:
      description: The review environment domain
      default: ''
    review-autostop-duration:
      description: The amount of time before GitLab will automatically stop `review` environments
      default: 4 hours
    cleanup-all-review:
      description: Cleanup all review environments
      default: ''
@@ -268,6 +271,7 @@ variables:
  # [optional]  CF_REVIEW_PASSWORD    : specific Cloud Foundry password in review env (defaults to $CF_PASSWORD)
  CF_REVIEW_ENVIRONMENT_SCHEME: $[[ inputs.review-environment-scheme ]]
  CF_REVIEW_ENVIRONMENT_DOMAIN: $[[ inputs.review-environment-domain ]]
  CF_REVIEW_AUTOSTOP_DURATION: $[[ inputs.review-autostop-duration ]]
  CLEANUP_ALL_REVIEW: $[[ inputs.cleanup-all-review ]]

  CF_INTEG_URL: $[[ inputs.integ-url ]]
@@ -1379,6 +1383,7 @@ cf-review:
    name: review/$CI_COMMIT_REF_NAME
    url: "${CF_REVIEW_ENVIRONMENT_SCHEME}://${CI_PROJECT_NAME}-${CI_ENVIRONMENT_SLUG}.${CF_REVIEW_ENVIRONMENT_DOMAIN}"
    on_stop: cf-cleanup-review
    auto_stop_in: "$CF_REVIEW_AUTOSTOP_DURATION"
  resource_group: review/$CI_COMMIT_REF_NAME
  rules:
    # exclude tags