Skip to content

Instantly share code, notes, and snippets.

@tyler-johnson
Last active July 19, 2017 18:38
Show Gist options
  • Save tyler-johnson/9edb36105861a3366812717f01e19d99 to your computer and use it in GitHub Desktop.
Save tyler-johnson/9edb36105861a3366812717f01e19d99 to your computer and use it in GitHub Desktop.
setup gitlab runner for Ubuntu and Docker

Run this in Ubuntu:

bash -c "$(curl https://gist.githubusercontent.com/tyler-johnson/9edb36105861a3366812717f01e19d99/raw/gitlab-runner-setup.sh)"
#!/bin/bash
# Update the OS
sudo apt-get update
sudo apt-get upgrade -y
# Install Docker
curl -sSL https://get.docker.com/ | sh
# Install Docker Compose
sudo apt-get install python-pip -y
sudo pip install --upgrade pip
sudo pip install docker-compose
# Setup Compose
echo "
gitlab-runner:
image: \"gitlab/gitlab-runner:latest\"
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/gitlab-runner:/etc/gitlab-runner
" > docker-compose.yml
# Start the Runner
docker-compose up -d
# Register and Configure the Runner
docker exec -i $(docker-compose ps -q gitlab-runner) gitlab-runner register
vi /etc/gitlab-runner/config.toml
# Restart the Runner
docker-compose restart gitlab-runner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment