Skip to content

Instantly share code, notes, and snippets.

@ebal
Last active December 2, 2022 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebal/b0333f9c7e5378bb95a395b3cba623d7 to your computer and use it in GitHub Desktop.
Save ebal/b0333f9c7e5378bb95a395b3cba623d7 to your computer and use it in GitHub Desktop.
Run GitLab-Runner on your system for local builds
#!/bin/bash
# This will be the directory to save our artifacts
TEMPDIR=$(mktemp -p . -d)
# You can choose to run a different job
[[ -z "$1" ]] && JOB="run-build" || JOB="$1"
# GitLab Runner - docker
gitlab-runner exec docker \
--docker-dns=1.1.1.1 \
--docker-volumes="$PWD/${TEMPDIR}":/builds:rw \
"${JOB}"
# Fix perms in artifacts directory
sudo chown -R "$(id -u):$(id -g)" "${TEMPDIR}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment