WIP, expanding runner construction

This commit is contained in:
Adam Shamblin 2022-10-17 20:35:49 -06:00
parent d4d3186521
commit 3bf2e0cd5b
No known key found for this signature in database
GPG Key ID: 22E0BC8E6B4D8C8E
3 changed files with 41 additions and 3 deletions

View File

@ -2,19 +2,26 @@
become: yes
hosts: all
tasks:
- name: Install Dependencies
- name: install-dependencies
ansible.builtin.apt:
pkg:
- ca-certificates
- curl
- gnupg
- lsb-release
- name: Install Docker Sources
- git
- name: install-docker-sources
ansible.builtin.script: ./docker-sources.sh
- name: Install Docker Packages
- name: install-docker-packages
ansible.builtin.apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
- name: install-earthly
ansible.builtin.script: ./earthly-setup.sh
- name: install-gitlab-runner
ansible.builtin.script: ./gitlab-runner.sh install
- name: register-gitlab-runner
ansible.buildin.script: ./gitlab-runner.sh register

6
cicd/earthly-setup.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
wget https://github.com/earthly/earthly/releases/download/v0.6.27/earthly-linux-amd64 \
-O /usr/local/bin/earthly
chmod +x /usr/local/bin/earthly
/usr/local/bin/earthly bootstrap

25
cicd/gitlab-runner.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
install () {
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
}
register () {
docker run --rm -it \
-v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
}
case $1 in
install)
install
;;
register)
register
;;
esac