Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
registrator
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
R3
apps
tailorbird
registrator
Merge requests
!2
Registrator release for Tailorbird 0.0.1
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Registrator release for Tailorbird 0.0.1
develop
into
master
Overview
0
Commits
11
Pipelines
2
Changes
4
Merged
Daniel Duarte
requested to merge
develop
into
master
5 years ago
Overview
0
Commits
11
Pipelines
2
Changes
4
Expand
👍
0
👎
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
1f712bbe
11 commits,
5 years ago
4 files
+
77
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
registrator/register.sh
0 → 100644
+
30
−
0
Options
#!/usr/bin/env bash
# The data will be sent to this URL with POST request
REGISTER_URL
=
"
${
REGISTER_URL
:
=https
://10.240.6.12/register
}
"
# Debug flag
DEBUG
=
${
DEBUG
:
=false
}
# MD5 checksum of register script
VERSION
=
`
cat
register.sh |
md5sum
|
cut
-d
' '
-f
1
`
# Get envvars which start with "CI" or "GITLAB"
# and then transform 'key=value' into '"key":"value",' and append version (md5 hash)
COLLECTED_INFO
=
$(
printenv
|
grep
'CI\|GITLAB'
|
echo
{
$(
sed
-e
's/^/\"/g; s/$/\", /g; s/=/\":\"/g;'
)
\"
v
\"
:
\"
$VERSION
\"
}
)
# To avoid mess with double apostrophes, encode using base64
ENCODED_INFO
=
$(
echo
$COLLECTED_INFO
|
base64
|
tr
-d
' \n'
)
# Debug messages
if
[[
"
$DEBUG
"
==
"true"
]]
;
then
echo
$COLLECTED_INFO
echo
$ENCODED_INFO
echo
"curl -X POST -kL -H
\"
Content-Type: text/base64
\"
-d
$ENCODED_INFO
$REGISTER_URL
"
else
# Making an actual request; follow redirects and allow insecure certificates.
curl
-X
POST
-kL
-H
"Content-Type: text/base64"
-d
$ENCODED_INFO
$REGISTER_URL
fi
;
# Return success
exit
0
Loading