Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0d6047bb
Commit
0d6047bb
authored
Apr 07, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup existing MR review-app by helm 2
parent
a56414a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
.gitlab/ci/review.gitlab-ci.yml
.gitlab/ci/review.gitlab-ci.yml
+1
-0
scripts/review_apps/review-apps.sh
scripts/review_apps/review-apps.sh
+30
-0
No files found.
.gitlab/ci/review.gitlab-ci.yml
View file @
0d6047bb
...
...
@@ -148,6 +148,7 @@ review-stop-failed-deployment:
stage
:
prepare
script
:
-
delete_failed_release
-
delete_helm2_release
review-stop
:
extends
:
...
...
scripts/review_apps/review-apps.sh
View file @
0d6047bb
...
...
@@ -95,6 +95,36 @@ function delete_failed_release() {
fi
}
function
helm2_deploy_exists
()
{
local
namespace
=
"
${
1
}
"
local
release
=
"
${
2
}
"
local
deploy_exists
echoinfo
"Checking if Helm 2
${
release
}
exists in the
${
namespace
}
namespace..."
true
kubectl get cm
-l
OWNER
=
TILLER
-n
${
namespace
}
|
grep
${
release
}
2>&1
deploy_exists
=
$?
echoinfo
"Helm 2 release for
${
release
}
is
${
deploy_exists
}
"
return
$deploy_exists
}
function
delete_helm2_release
()
{
local
namespace
=
"
${
KUBE_NAMESPACE
}
"
local
release
=
"
${
CI_ENVIRONMENT_SLUG
}
"
if
[
-z
"
${
release
}
"
]
;
then
echoerr
"No release given, aborting the delete!"
return
fi
if
!
helm2_deploy_exists
"
${
namespace
}
"
"
${
release
}
"
;
then
echoinfo
"No Review App with
${
release
}
is currently deployed by Helm 2."
else
echoinfo
"Cleaning up
${
release
}
installed by Helm 2"
kubectl_cleanup_release
"
${
namespace
}
"
"
${
release
}
"
fi
}
function
get_pod
()
{
local
namespace
=
"
${
KUBE_NAMESPACE
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment