summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-27 18:06:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-27 18:06:30 +0000
commit20758bc3b33c04121d214cb89646baf880037a27 (patch)
tree66b821724d9e050002a956acefc1111c2ef0feab /scripts
parenta98649b71085bcd21af674a47d6a746336c56a65 (diff)
downloadgitlab-ce-20758bc3b33c04121d214cb89646baf880037a27.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/review_apps/review-apps.sh22
-rwxr-xr-xscripts/trigger-build2
2 files changed, 22 insertions, 2 deletions
diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh
index 1c33bff719d..62360dfe298 100755
--- a/scripts/review_apps/review-apps.sh
+++ b/scripts/review_apps/review-apps.sh
@@ -48,11 +48,31 @@ function delete_release() {
return
fi
- echoinfo "Deleting release '${release}'..." true
+ helm_delete_release "${namespace}" "${release}"
+ kubectl_cleanup_release "${namespace}" "${release}"
+}
+
+function helm_delete_release() {
+ local namespace="${1}"
+ local release="${2}"
+
+ echoinfo "Deleting Helm release '${release}'..." true
helm delete --tiller-namespace "${namespace}" --purge "${release}"
}
+function kubectl_cleanup_release() {
+ local namespace="${1}"
+ local release="${2}"
+
+ echoinfo "Deleting all K8s resources matching '${release}'..." true
+ kubectl --namespace "${namespace}" get ingress,svc,pdb,hpa,deploy,statefulset,job,pod,secret,configmap,pvc,secret,clusterrole,clusterrolebinding,role,rolebinding,sa,crd 2>&1 \
+ | grep "${release}" \
+ | awk '{print $1}' \
+ | xargs kubectl --namespace "${namespace}" delete \
+ || true
+}
+
function delete_failed_release() {
local namespace="${KUBE_NAMESPACE}"
local release="${CI_ENVIRONMENT_SLUG}"
diff --git a/scripts/trigger-build b/scripts/trigger-build
index 74c1df258c0..537b2692b27 100755
--- a/scripts/trigger-build
+++ b/scripts/trigger-build
@@ -71,7 +71,7 @@ module Trigger
# Can be overridden
def version_param_value(version_file)
- File.read(version_file).strip
+ ENV[version_file]&.strip || File.read(version_file).strip
end
def variables