Giter Club home page Giter Club logo

gitlab-vagrant-executor's Introduction

gitlab-vagrant-executor

Run vagrant libvirt-kvm vms as envs for gitlab jobs.

Concept

Use https://docs.gitlab.com/runner/executors/custom.html for run libvirt kvm VMs use Vagrant as wrapper.

Setup

On runner host

  1. gitlab-runner register

and chose custom

  1. Edit section of creation runner in file /etc/gitlab-runner/config.toml
[[runners]]
  name = "your-runner-name"
  url = "https://gitlab.example.com"
  token = "SUPERSECRETTOKEN"
  executor = "custom"
  output_limit = 16384 # optional
  builds_dir = "/home/vagrant/builds"
  cache_dir = "/home/vagrant/cache"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.custom]
    prepare_exec = "/opt/vagrant-driver/prepare.sh"
    run_exec = "/opt/vagrant-driver/run.sh"
    cleanup_exec = "/opt/vagrant-driver/cleanup.sh"
  1. Copy bash scripts and Vagrantfile in /opt/vagrant-driver

  2. kill -SIGHUP $(pidof gitlab-runner) or restart runner process.

  3. Install qemu, kvm, libvirt, Vagrant, etc...

  4. vagrant plugin install vagrant-libvirt

Use

Use this runner as usual

.gitlab-ci.yml

echo:
  stage: test
  script:
    - echo test
  tags:
    - vagrant-executor

Or configure VMs (all vars bellow are default, you can change it)

echo:
  stage: test
  variables:
  	VAGRANT_VM_MEMORY: 2048
  	VAGRANT_VM_CPUS: 2
  	VAGRANT_BOX_NAME: andreineustroev/ubuntu-ci
  	VAGRANT_BOX_VERSION: 0.0.3
  script:
    - echo test
  tags:
    - vagrant-executor

gitlab-vagrant-executor's People

Contributors

andreineustroev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.