Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
hivemind
Commits
abb895e4
Commit
abb895e4
authored
4 years ago
by
Wojciech Barcik
Browse files
Options
Downloads
Patches
Plain Diff
Better script for starting hive server
parent
18a27559
No related branches found
No related tags found
2 merge requests
!456
Release candidate v1 24
,
!340
Switch back to old gitlab ci executor
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/ci/hive-server.sh
+35
-4
35 additions, 4 deletions
scripts/ci/hive-server.sh
with
35 additions
and
4 deletions
scripts/ci/hive-server.sh
+
35
−
4
View file @
abb895e4
#!/bin/bash
# TODO This script needs review.
set
-euo
pipefail
HIVEMIND_PID
=
0
...
...
@@ -9,16 +11,27 @@ START_DELAY=5
# For debug only!
# HIVED_URL='{"default":"http://hived-node:8091"}'
# HIVED_URL='{"default":"http://172.17.0.1:8091"}'
# HIVED_URL='{"default":"http://127.0.0.1:8091"}'
# HIVEMIND_HTTP_PORT="8080"
# HIVEMIND_POSTGRESQL_CONNECTION_STRING="postgresql://syncad:devdev@localhost:5432/hive_test"
check_pid
()
{
if
[
-f
hive_server.pid
]
;
then
HIVEMIND_PID
=
`
cat
hive_server.pid
`
if
ps
-p
$HIVEMIND_PID
>
/dev/null
then
# Process is running
echo
"Process pid
$HIVEMIND_PID
is running"
else
# Process is not running
rm
hive_server.pid
HIVEMIND_PID
=
0
fi
else
HIVEMIND_PID
=
0
fi
}
stop
()
{
if
[
"
$HIVEMIND_PID
"
-gt
"0"
]
;
then
HIVEMIND_PID
=
`
cat
hive_server.pid
`
...
...
@@ -61,16 +74,34 @@ start() {
for
i
in
`
seq
1 10
`
;
do
if
[
-f
hive_server.pid
]
;
then
echo
"Hive server has been started (pid
$HIVEMIND_PID
)"
echo
"Starting hive server (pid
$HIVEMIND_PID
)"
# Wait some time to allow its initialization.
sleep
$START_DELAY
exit
0
# Check if process is still running.
if
ps
-p
$HIVEMIND_PID
>
/dev/null
then
echo
"Hive server is running (pid
$HIVEMIND_PID
)"
exit
0
else
# Check if process executed successfully or not.
if
wait
$HIVEMIND_PID
;
then
echo
"Hive server has been started (pid
$HIVEMIND_PID
)"
exit
0
else
RESULT
=
$?
echo
"Hive server terminated abnormally (returned
$RESULT
)"
rm
hive_server.pid
;
exit
$RESULT
fi
fi
else
sleep
1
fi
done
# If we are here something went wrong
# If we are here
,
something went wrong
.
echo
"Timeout reached. Hive server has not been started, exiting."
rm
hive_server.pid
;
exit
1
}
...
...
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