Sure, here's a sample readme file for this code:
This repository contains a Vagrantfile that sets up a virtual machine (VM) for running GitLab and GitHub runners. The VM is configured using the libvirt and VirtualBox providers, and includes the necessary environment variables and scripts to run CI pipelines on GitLab and GitHub.
To install Vagrant, please follow the steps below:
- Go to the Vagrant downloads page
- Click on the download link for your operating system.
- After downloading the installer, run it and follow the installation instructions.
- Once the installation is complete, open a terminal or command prompt and type
vagrant
to verify that Vagrant is installed correctly.
That's it! You now have Vagrant installed on your machine and can use it to create and manage virtual machines.
To use this repository, you need to have Vagrant installed on your local machine. You also need to install the vagrant-reload
plugin by running the following command:
vagrant plugin install vagrant-reload
-
Clone this repository and navigate to the project directory:
git clone https://github.com/arunlab/vagrant-github-runners.git cd vagrant-github-runner
-
Set the required environment variables by opening the Vagrantfile and updating the values of the following variables:
export GITLABCI_NAME=my-gitlab-runner export GITLABCI_URL=https://gitlab-ci.local/ export GITLABCI_TOKEN=changeme export GITLABCI_EXECUTOR=docker export GITLABCI_TAGS=''
-
Start the VM by running the following command:
cd vagrant up
-
Wait for Vagrant to provision the VM and install all necessary software.
-
Once the VM is up and running, you can SSH into it by running:
vagrant ssh
-
You should now be able to run GitLab and GitHub runners inside the VM.
The Vagrantfile includes several configuration options that you can modify to customize your VM setup. Some of the key settings are:
V_CPU
: Number of CPU cores to allocate to the VM.V_MEM
: Amount of memory (in megabytes) to allocate per core.SYNC_TYPE
: Method used to sync files in the VM (e.g. 'rsync').config.vm.provider
: Configuration for each provider (libvirt or VirtualBox).config.vm.provision
: Provisioning scripts and commands to run inside the VM.
You can modify these settings to match your system requirements and desired setup.
If you encounter any issues when running this Vagrant setup, try the following troubleshooting steps:
- Make sure you have installed Vagrant and the
vagrant-reload
plugin correctly. - Check that the environment variables in the Vagrantfile are set correctly.
- Review the provisioning scripts to see if there are any errors or configuration issues.
- Check the logs and error messages for more information on what went wrong.
This repository is licensed under the MIT License. Feel free to use and modify this code as needed.