Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gitlab-runner-docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shore
gitlab-runner-docker
Commits
7d05f20d
Commit
7d05f20d
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Handle errors a little better.
parent
f311f190
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#436
failed
4 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deploy
+8
-2
8 additions, 2 deletions
deploy
with
8 additions
and
2 deletions
deploy
+
8
−
2
View file @
7d05f20d
#!/bin/sh
set
-eu
_check
()
{
containers
=
"
$(
until
docker-compose ps
-q
;
do
true
;
done
)
"
# shellcheck disable=SC2086
docker container inspect
--format
'{{ .State.Health.Status }}'
$containers
|
grep
-v
'^healthy$'
}
_deploy
()
{
echo
"Deploying to
$1
"
>
&2
export
DOCKER_HOST
=
"ssh://
$1
"
...
...
@@ -10,11 +16,11 @@ _deploy() {
for
i
in
$(
seq
12
)
do
# shellcheck disable=SC2046
docker container inspect
--format
'{{ .State.Health.Status }}'
$(
docker-compose ps
-q
)
|
grep
-v
'^healthy$'
||
break
_check
||
break
sleep
10
done
# shellcheck disable=SC2046
!
docker container inspect
--format
'{{ .State.Health.Status }}'
$(
docker-compose ps
-q
)
|
grep
-v
'^healthy$'
!
_check
unset
DOCKER_HOST
unset
RUNNER_NAME
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment