Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clive
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
Environments
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
clive
Commits
bd43c47c
Commit
bd43c47c
authored
4 months ago
by
Wieslaw Kedzierski
Browse files
Options
Downloads
Patches
Plain Diff
Simplifie activate_beekeeper.sh script by using clive beekeeper spawn and create-session commands.
parent
09f8c801
No related branches found
No related tags found
2 merge requests
!555
v1.27.5.20 Release
,
!518
Add possibility of creating beekeeper session with clive
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/activate_beekeeper.sh
+5
-15
5 additions, 15 deletions
scripts/activate_beekeeper.sh
with
5 additions
and
15 deletions
scripts/activate_beekeeper.sh
+
5
−
15
View file @
bd43c47c
...
...
@@ -5,27 +5,17 @@ trap "clean_up" SIGTERM SIGQUIT SIGHUP EXIT
# Start Beekeeper with prepared session token
start_beekeeper_with_prepared_session_token
()
{
output
=
$(
clive beekeeper spawn
)
CLIVE_BEEKEEPER__REMOTE_ADDRESS
=
$(
clive beekeeper spawn
--echo-address-only
)
# shellcheck disable=SC2181
if
[[
$?
-ne
0
]]
;
then
echo
"Error: Fail to spawn Beekeeper. Aborting..."
exit
1
fi
CLIVE_BEEKEEPER__REMOTE_ADDRESS
=
$(
echo
"
$output
"
|
grep
-oE
'http://[0-9.]+:[0-9]+'
)
CLIVE_BEEKEEPER__SESSION_TOKEN
=
$(
curl
-s
--data
'{
"jsonrpc": "2.0",
"method": "beekeeper_api.create_session",
"params": {
"salt": "clive-cli-session",
"notifications_endpoint": "'
"
${
CLIVE_BEEKEEPER__REMOTE_ADDRESS
}
"
'"
},
"id": 1
}'
"
${
CLIVE_BEEKEEPER__REMOTE_ADDRESS
}
"
| jq .result.token |
tr
-d
'"'
)
if
[[
"
${
CLIVE_BEEKEEPER__SESSION_TOKEN
}
"
==
"null"
]]
;
then
echo
"Error: There is no valid token."
CLIVE_BEEKEEPER__SESSION_TOKEN
=
$(
clive beekeeper create-session
--echo-token-only
)
# shellcheck disable=SC2181
if
[[
$?
-ne
0
]]
;
then
echo
"Error: Failed to create a new beekeeper session. Aborting..."
exit
1
fi
...
...
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