GitLab CI/CD for GitHub allows to host the code on GitHub and test it on GitLab. This repository contains a recipe to use the GitLab CI/CD infrastucture with a GitHub repository. The recipe installs and configures a GitLab-runner using ansible.
Before going through the following steps, make sure that you have a GitLab account then follow the instructions described at using the GitLab CI/CD with GitHub.
- Install Ansible in your computer.
- Clone this repo.
- Edit the inventory file with the address of the server(s) where you want to install the runner.
- Edit the playbook file with the
remote_user
name for the hosts. - Make sure that you can ssh to your server(s).
- Install the runner with the following command:
ansible-playbook -i inventory playbook.yml
The script will ask you for a token for your new runner, you can find such token in the configuration of the CI/CD at the mirror repository that GitLab automatically creates for you. See the configuration instructions.
GitLabCI makes use of tags to select a specific runner from the available pool. You can create your own tag to name your GitLab-runner
and use it as default. You can replace the name of the tag in the playbook.yml file.
Currently the recipe only works for Ubuntu and Debian