2021-11-11 11:23:49 +05:30
|
|
|
variables:
|
2022-07-16 23:28:13 +05:30
|
|
|
DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.28.2'
|
2021-11-11 11:23:49 +05:30
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
.dast-auto-deploy:
|
2021-11-11 11:23:49 +05:30
|
|
|
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${DAST_AUTO_DEPLOY_IMAGE_VERSION}"
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
dast_environment_deploy:
|
2019-12-26 22:10:19 +05:30
|
|
|
extends: .dast-auto-deploy
|
2019-12-21 20:55:43 +05:30
|
|
|
stage: review
|
|
|
|
script:
|
|
|
|
- auto-deploy check_kube_domain
|
|
|
|
- auto-deploy download_chart
|
2021-12-11 22:18:48 +05:30
|
|
|
- auto-deploy use_kube_context || true
|
2019-12-21 20:55:43 +05:30
|
|
|
- auto-deploy ensure_namespace
|
|
|
|
- auto-deploy initialize_tiller
|
|
|
|
- auto-deploy create_secret
|
|
|
|
- auto-deploy deploy
|
|
|
|
- auto-deploy persist_environment_url
|
|
|
|
environment:
|
|
|
|
name: dast-default
|
|
|
|
url: http://dast-$CI_PROJECT_ID-$CI_ENVIRONMENT_SLUG.$KUBE_INGRESS_BASE_DOMAIN
|
|
|
|
on_stop: stop_dast_environment
|
|
|
|
artifacts:
|
|
|
|
paths: [environment_url.txt]
|
2020-05-24 23:13:21 +05:30
|
|
|
rules:
|
|
|
|
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_REF_NAME
|
|
|
|
when: never
|
|
|
|
- if: $DAST_DISABLED || $DAST_DISABLED_FOR_DEFAULT_BRANCH
|
|
|
|
when: never
|
2020-10-24 23:57:45 +05:30
|
|
|
- if: $DAST_WEBSITE # we don't need to create a review app if a URL is already given
|
2020-05-24 23:13:21 +05:30
|
|
|
when: never
|
|
|
|
- if: $CI_COMMIT_BRANCH &&
|
2021-12-11 22:18:48 +05:30
|
|
|
($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
|
2020-05-24 23:13:21 +05:30
|
|
|
$GITLAB_FEATURES =~ /\bdast\b/
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
stop_dast_environment:
|
2019-12-26 22:10:19 +05:30
|
|
|
extends: .dast-auto-deploy
|
2019-12-21 20:55:43 +05:30
|
|
|
stage: cleanup
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
script:
|
2021-12-11 22:18:48 +05:30
|
|
|
- auto-deploy use_kube_context || true
|
2019-12-21 20:55:43 +05:30
|
|
|
- auto-deploy initialize_tiller
|
|
|
|
- auto-deploy delete
|
|
|
|
environment:
|
|
|
|
name: dast-default
|
|
|
|
action: stop
|
|
|
|
needs: ["dast"]
|
2020-05-24 23:13:21 +05:30
|
|
|
rules:
|
|
|
|
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_REF_NAME
|
|
|
|
when: never
|
|
|
|
- if: $DAST_DISABLED || $DAST_DISABLED_FOR_DEFAULT_BRANCH
|
|
|
|
when: never
|
2020-10-24 23:57:45 +05:30
|
|
|
- if: $DAST_WEBSITE # we don't need to create a review app if a URL is already given
|
2020-05-24 23:13:21 +05:30
|
|
|
when: never
|
|
|
|
- if: $CI_COMMIT_BRANCH &&
|
2021-12-11 22:18:48 +05:30
|
|
|
($CI_KUBERNETES_ACTIVE || $KUBECONFIG) &&
|
2020-05-24 23:13:21 +05:30
|
|
|
$GITLAB_FEATURES =~ /\bdast\b/
|
2020-07-28 23:09:34 +05:30
|
|
|
when: always
|