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
6dadd965
Commit
6dadd965
authored
Apr 08, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Poll Review App after it's deployed to ensure it's accessible
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
2347b04e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
scripts/review_apps/review-apps.sh
scripts/review_apps/review-apps.sh
+25
-0
No files found.
scripts/review_apps/review-apps.sh
View file @
6dadd965
...
...
@@ -114,6 +114,7 @@ function perform_review_app_deployment() {
install_tiller
install_external_dns
time
deploy
wait_for_review_app_to_be_accessible
add_license
}
...
...
@@ -202,6 +203,7 @@ function download_gitlab_chart() {
}
function
deploy
()
{
set
+e
local
track
=
"
${
1
-stable
}
"
local
name
=
"
$CI_ENVIRONMENT_SLUG
"
...
...
@@ -300,6 +302,29 @@ EOF
echoinfo
"
${
HELM_CMD
}
"
eval
$HELM_CMD
set
-e
}
function
wait_for_review_app_to_be_accessible
()
{
# In case the Review App isn't completely available yet. Keep trying for 5 minutes.
local
interval
=
5
local
elapsed_seconds
=
0
local
max_seconds
=
5
*
60
while
true
;
do
local
review_app_http_code
=
$(
curl
--silent
--output
/dev/null
--max-time
5
--write-out
"%{http_code}"
"
${
CI_ENVIRONMENT_URL
}
/users/sign_in"
)
([[
"
${
review_app_http_code
}
"
!=
"200"
]]
&&
[[
"
${
elapsed_seconds
}
"
-lt
"
${
max_seconds
}
"
]])
||
break
printf
"."
let
"elapsed_seconds+=interval"
sleep
${
interval
}
done
if
[[
"
${
review_app_http_code
}
"
==
"200"
]]
;
then
echoinfo
"The Review App at
${
CI_ENVIRONMENT_URL
}
is ready!"
else
echoerr
"The Review App at
${
CI_ENVIRONMENT_URL
}
isn't ready after 5 minutes of polling..."
exit
1
fi
}
function
add_license
()
{
...
...
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