Skip to content

Instantly share code, notes, and snippets.

@tfmeneses
Last active March 24, 2023 21:55
Show Gist options
  • Save tfmeneses/c023fc016ad2583a6170fdd1127bfe34 to your computer and use it in GitHub Desktop.
Save tfmeneses/c023fc016ad2583a6170fdd1127bfe34 to your computer and use it in GitHub Desktop.
1#
mkdir my-git-project
cd my-git-project
git init
git commit --allow-empty -m"Initialize repo to showcase gitlab-runner locally."
#2
Example .gitlab-ci.yml
image: alpine
test:
script:
- echo "Hello Gitlab-Runner"
3. Create a docker container with your project dir mounted
docker run -d --name gitlab-runner --network=host --restart always -v ${PWD}:/opt/myapp -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
docker exec -it -w /opt/myapp gitlab-runner gitlab-runner exec docker test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment