cvwiki

Gitlab CI/CD

Apr 2, 2022

# Using gitlab-runner to test ci locally

1
brew install gitlab-runner
1
brew services start gitlab-runner
1
brew services restart gitlab-runner
1
2
3
build:
  script:
    - echo "Hello World"
1
gitlab-runner exec shell build

# Consuming an npm package from private GitLab Package Registry

  1. Set registry and ensure authentication is configured via project access token. Add the following to your .npmrc at the root directory of your project that will be consuming from the private registry.
1
2
3
@my_scope:registry=https://gitlab.com/api/v4/projects/$PROJECT_ID/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=$PROJECT_ACCESS_TOKEN
//gitlab.com/api/v4/projects/$PROJECT_ID/packages/npm/:_authToken=$PROJECT_ACCESS_TOKEN
  1. To install the package, run
1
npm install @my-scope/my-package