-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitlab-runner.yaml
45 lines (45 loc) · 1.26 KB
/
gitlab-runner.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#cloud-config
# - Required Extra Vars
# $GITLAB_URL
# $GITLAB_TOKEN
# $DESCRIPTION
# $UNTAGGED
# $LOCKED
# $ACCESS_LEVEL
hostname: ${VM_NAME}
fqdn: ${VM_NAME}
disable_root: false
users:
- name: ${USERNAME}
groups: users, admin, docker, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
passwd: ${PASSWORD}
ssh_import_id:
- gh:${GITHUB_USER}
- name: ${VM_ADMIN}
gecos: system acct
groups: users, admin, docker, sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
lock_passwd: false
passwd: ${PASSWORD}
ssh_authorized_keys:
- ${VM_KEY}
bootcmd:
- apt-get update
- apt-get install -y ssh-import-id
package_update: ${UPDATE}
package_upgrade: ${UPGRADE}
packages:
- wget
- curl
- git
- build-essential
- python3-pip
- docker.io
runcmd:
- curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_amd64.deb"
- dpkg -i /*.deb
- sudo gitlab-runner register --non-interactive --url "${GITLAB_URL}" --registration-token "${GITLAB_TOKEN}" --executor "docker" --docker-image alpine:latest --description "${DESCRIPTION}" --maintenance-note "Free-form maintainer notes about this runner" --run-untagged=${UNTAGGED} --locked=${LOCKED} --access-level=${ACCESS_LEVEL}