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
5a1659d8
Commit
5a1659d8
authored
Sep 09, 2019
by
Kyle Wiebers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add review-cleanup-failed-deployment to prepare
Add in a job to purge previous release in Review App
parent
7e8453fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
.gitlab/ci/review.gitlab-ci.yml
.gitlab/ci/review.gitlab-ci.yml
+9
-0
scripts/review_apps/review-apps.sh
scripts/review_apps/review-apps.sh
+20
-1
No files found.
.gitlab/ci/review.gitlab-ci.yml
View file @
5a1659d8
...
@@ -134,6 +134,15 @@ review-stop:
...
@@ -134,6 +134,15 @@ review-stop:
artifacts
:
artifacts
:
paths
:
[]
paths
:
[]
review-cleanup-failed-deployment
:
extends
:
review-stop
stage
:
prepare
when
:
on_success
needs
:
[]
allow_failure
:
false
script
:
-
delete_failed_release
.review-qa-base
:
.review-qa-base
:
extends
:
extends
:
-
.review-docker
-
.review-docker
...
...
scripts/review_apps/review-apps.sh
View file @
5a1659d8
...
@@ -49,6 +49,26 @@ function delete_release() {
...
@@ -49,6 +49,26 @@ function delete_release() {
helm delete
--purge
"
$name
"
helm delete
--purge
"
$name
"
}
}
function
delete_failed_release
()
{
if
[
-z
"
$CI_ENVIRONMENT_SLUG
"
]
;
then
echoerr
"No release given, aborting the delete!"
return
fi
if
!
deploy_exists
"
${
KUBE_NAMESPACE
}
"
"
${
CI_ENVIRONMENT_SLUG
}
"
;
then
echoinfo
"No Review App with
${
CI_ENVIRONMENT_SLUG
}
is currently deployed."
else
# Cleanup and previous installs, as FAILED and PENDING_UPGRADE will cause errors with `upgrade`
if
previous_deploy_failed
"
$CI_ENVIRONMENT_SLUG
"
;
then
echoinfo
"Review App deployment in bad state, cleaning up
$CI_ENVIRONMENT_SLUG
"
delete_release
else
echoinfo
"Review App deployment in good state"
fi
fi
}
function
get_pod
()
{
function
get_pod
()
{
local
app_name
=
"
${
1
}
"
local
app_name
=
"
${
1
}
"
local
status
=
"
${
2
-Running
}
"
local
status
=
"
${
2
-Running
}
"
...
@@ -193,7 +213,6 @@ function deploy() {
...
@@ -193,7 +213,6 @@ function deploy() {
HELM_CMD
=
$(
cat
<<
EOF
HELM_CMD
=
$(
cat
<<
EOF
helm upgrade --install
\
helm upgrade --install
\
--force
\
--wait
\
--wait
\
--timeout 900
\
--timeout 900
\
--set releaseOverride="
$CI_ENVIRONMENT_SLUG
"
\
--set releaseOverride="
$CI_ENVIRONMENT_SLUG
"
\
...
...
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