| 1 | #!/bin/bash |
| 2 | # depends on https://gist.github.com/waja/01ba2641f93f461044f9 |
| 3 | [ "$(cat /etc/debian_version | awk -F. {'print $1'})" -ne "8" ] && echo exit 1 |
| 4 | cat >/etc/apt/sources.list.d/runner_gitlab-ci-multi-runner.list <<EOF |
| 5 | # this file was generated by packages.gitlab.com for |
| 6 | # the repository at https://packages.gitlab.com/runner/gitlab-ci-multi-runner |
| 7 | |
| 8 | deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/ jessie main |
| 9 | deb-src https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/ jessie main |
| 10 | EOF |
| 11 | wget -O - https://packages.gitlab.com/gpg.key | apt-key add - |
| 12 | aptitude update; aptitude install gitlab-ci-multi-runner |
| 13 | cat >/etc/cron.daily/gitlab-ci_clean_orphaned_docker_images <<EOF |
| 14 | #!/bin/bash |
| 15 | for i in $(docker ps -a | grep "weeks ago" | cut -f1 -d" "); do docker stop $i && docker rm $i; done |
| 16 | EOF |
| 17 | chmod +x /etc/cron.daily/gitlab-ci_clean_orphaned_docker_images |
waja / gist:d281d3a2aa3b4749833e4bded299bd27
Last active 3 months ago
Revision ce55bcc702a7c18649f0bb061c5b220e89c6d406