Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anton Palgunov
mkimage-profiles
Commits
4bcf7a17
Commit
4bcf7a17
authored
Dec 04, 2021
by
Konstantin A. Lepikhov
Committed by
Anton Midyukov
Dec 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
features: add gitlab-runner
- Add gitlab-runner feature.
parent
a0068021
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
0 deletions
+85
-0
README
features.in/gitlab-runner/README
+11
-0
config.mk
features.in/gitlab-runner/config.mk
+13
-0
60-gitlab-install
...in/gitlab-runner/rootfs/image-scripts.d/60-gitlab-install
+61
-0
No files found.
features.in/gitlab-runner/README
0 → 100644
View file @
4bcf7a17
This feature installs gitlab-runner according official guide [1]
The following envs can be altered:
GL_USER - define default gitlab-runner username ('gitlab-runner' by default)
GL_SSH_KEY - ssh pubkey added to authorized_keys of GL_USER
NOTE: this feature depends on network enablement in hasher (see [2] for details)
1. https://docs.gitlab.com/runner/install/linux-manually.html
2. https://bugzilla.altlinux.org/34596
features.in/gitlab-runner/config.mk
0 → 100644
View file @
4bcf7a17
# WARNING: the variable values are stored in build config/log!
use/gitlab-runner:
@$(call add_feature)
@$(call add,THE_PACKAGES,shadow-utils passwd curl)
@$(call xport,GL_USER)
@$(call xport,GL_SSH_KEY)
# some presets
# USERS variable chunk format is "login:passwd:admin:sudo"
# GROUPS are just stashed there to include USERS logins created
# GL_SSH_KEY should be changed accordingly
use/gitlab-runner/defuser: use/gitlab-runner
@$(call add,GL_USER,gitlab-runner)
features.in/gitlab-runner/rootfs/image-scripts.d/60-gitlab-install
0 → 100755
View file @
4bcf7a17
#!/bin/sh -efu
gl_url
=
"https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-"
add_user
()
{
useradd
-c
'Gitlab Runner'
-m
"
$1
"
[
-z
"
$GLOBAL_GL_SSH_KEY
"
]
||
echo
"
$GLOBAL_GL_SSH_KEY
"
>>
/home/
"
$1
"
/.ssh/authorized_keys
usermod
-L
"
$1
"
||
echo
"*** failed to add user '
$1
'"
}
case
"
$GLOBAL_ARCH
"
in
x86_64
)
gl_url
=
"
${
gl_url
}
amd64"
;;
i586
)
gl_url
=
"
${
gl_url
}
386"
;;
armh
)
gl_url
=
"
${
gl_url
}
arm"
;;
aarch64
)
gl_url
=
"
${
gl_url
}
arm64"
;;
ppc64le
)
gl_url
=
"
${
gl_url
}
ppc64le"
;;
*
)
echo
"arch
$GLOBAL_ARCH
not supported!"
exit
1
;;
esac
if
[
-n
"
$GLOBAL_GL_USER
"
]
;
then
add_user
"
$GLOBAL_GL_USER
"
echo
'nameserver 8.8.8.8'
>>
/etc/resolv.conf
curl
-L
--output
/usr/local/bin/gitlab-runner
"
$gl_url
"
chmod
+x /usr/local/bin/gitlab-runner
cat
>
/lib/systemd/system/gitlab-runner.service
<<
EOF
[Unit]
Description=GitLab Runner
ConditionFileIsExecutable=/usr/local/bin/gitlab-runner
After=syslog.target network.target
[Service]
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/gitlab-runner "run" "--working-directory" "/home/
$GLOBAL_GL_USER
" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "
$GLOBAL_GL_USER
"
Restart=always
RestartSec=120
EnvironmentFile=-/etc/sysconfig/gitlab-runner
[Install]
WantedBy=multi-user.target
EOF
systemctl
enable
gitlab-runner
fi
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