Skip to content

Instantly share code, notes, and snippets.

@gmolveau
Last active July 29, 2020 13:46
Show Gist options
  • Select an option

  • Save gmolveau/5ffa1c8f53144976c644c4d68139aefb to your computer and use it in GitHub Desktop.

Select an option

Save gmolveau/5ffa1c8f53144976c644c4d68139aefb to your computer and use it in GitHub Desktop.
Run gitlab-ci locally with or without docker
stages:
- build
localbuild:
image: debian:10-slim
stage: build
script:
- pwd

Run gitlab-ci locally with/without docker

Install the gitlab-runner :

cf : https://docs.gitlab.com/runner/install/

# macOS
brew install gitlab-runner
# debian/ubuntu
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt-get install gitlab-runner
# centos
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh | sudo bash
sudo yum install gitlab-runner
# manually download and install (linux amd64 64bit)
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

With docker

gitlab-runner exec docker <name_of_the_job_in_gitlab-ci.yml>
# example
gitlab-runner exec docker localbuild

Without docker

gitlab-runner exec shell <name_of_the_job_in_gitlab-ci.yml>
# example
gitlab-runner exec shell localbuild

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment