Package Exports
- gitlab-ci-local
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gitlab-ci-local) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Tired of pushing to test your .gitlab-ci.yml?
Run gitlab pipelines locally as shell executor or docker executor.
Get rid of all those dev specific shell scripts and make files.
Table of contents
Installation
NPM
npm install -g gitlab-ci-localLinux
Download and put binary in /usr/local/bin
sudo su # must be installed as root, if placed in /usr/local/bin/
curl -L https://github.com/firecow/gitlab-ci-local/releases/latest/download/linux.gz | gunzip -c > /usr/local/bin/gitlab-ci-local
chmod +x /usr/local/bin/gitlab-ci-local
exitMacos
Download and put binary in /usr/local/bin
sudo su # must be installed as root, if placed in /usr/local/bin/
curl -L https://github.com/firecow/gitlab-ci-local/releases/latest/download/macOS.gz | gunzip -c > /usr/local/bin/gitlab-ci-local
chmod +x /usr/local/bin/gitlab-ci-local
exitWindows (Git bash)
Install gitbash
Download and put binary in C:\Program Files\Git\mingw64\bin
curl -L https://github.com/firecow/gitlab-ci-local/releases/latest/download/win.gz | gunzip -c > /c/Program\ Files/Git/mingw64/bin/gitlab-ci-local.exeConvinience
Bash alias
echo "alias gcl='gitlab-ci-local'" >> ~/.bashrcTab completion
gitlab-ci-local --completion >> ~/.bashrc Quirks
User variables
Put a file like this in $HOME/.gitlab-ci-local/variables.yml
---
project:
gitlab.com/test-group/test-project.git:
# Will be type Variable and only available if remote is exact match
AUTHORIZATION_PASSWORD: djwqiod910321
group:
gitlab.com/test-group/:
# Will be type Variable and only available for remotes that include group named 'test-group'
DOCKER_LOGIN_PASSWORD: dij3213n123n12in3
global:
# Will be type File, because value is a file path
SSH_PRIVATE_KEY: '~/.ssh/id_rsa'Variables will now appear in your jobs, if project or group matches git remote, global's are always present
Decorators
The @Description decorator
Adds descriptive text to gitlab-ci-local --list
# @Description Install npm packages
npm-install:
image: node
artifacts:
paths:
- node_modules/
script:
- npm install --no-audit
The @Interactive decorator
# @Interactive
interactive-shell:
rules:
- if: $GITLAB_CI == 'false'
when: manual
script:
- docker run -it debian bash
Artifacts
Shell executor just place files in host directory
Docker executor copies files specified via artifacts field to host
Development
Scripts
npm install
npm run build
npm start
Package binaries
npm run pkg-linux
npm run pkg-win
npm run pkg-macos
npm run pkg-all