GitHub Actions
- name: Configure Chainsaw
env:
CHAINSAW_CLIENT_ID: ${{ secrets.CHAINSAW_CLIENT_ID }}
CHAINSAW_CLIENT_SECRET: ${{ secrets.CHAINSAW_CLIENT_SECRET }}
run: |
AUTH=$(printf '%s' "$CHAINSAW_CLIENT_ID:$CHAINSAW_CLIENT_SECRET" | base64)
echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" >> .npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> .npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> .npmrc
- name: Install
run: npm ci
GitLab CI
install:
script:
- AUTH=$(printf '%s' "$CHAINSAW_CLIENT_ID:$CHAINSAW_CLIENT_SECRET" | base64)
- echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" >> ~/.npmrc
- echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> ~/.npmrc
- echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> ~/.npmrc
- npm ci
Jenkins
withCredentials([usernamePassword(credentialsId: 'chainsaw',
usernameVariable: 'CHAINSAW_CLIENT_ID', passwordVariable: 'CHAINSAW_CLIENT_SECRET')]) {
sh '''
AUTH=$(printf '%s' "$CHAINSAW_CLIENT_ID:$CHAINSAW_CLIENT_SECRET" | base64)
echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" > .npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> .npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> .npmrc
npm ci
'''
}
CircleCI
- run:
name: Configure Chainsaw
command: |
AUTH=$(printf '%s' "$CHAINSAW_CLIENT_ID:$CHAINSAW_CLIENT_SECRET" | base64)
echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" >> ~/.npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> ~/.npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> ~/.npmrc
- run: npm ci
Azure Pipelines
- script: |
AUTH=$(printf '%s' "$(CHAINSAW_CLIENT_ID):$(CHAINSAW_CLIENT_SECRET)" | base64)
echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" >> ~/.npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> ~/.npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> ~/.npmrc
npm ci
displayName: Install via Chainsaw
Buildkite
steps:
- label: "Install"
command: |
AUTH=$(printf '%s' "$CHAINSAW_CLIENT_ID:$CHAINSAW_CLIENT_SECRET" | base64)
echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" >> .npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> .npmrc
echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> .npmrc
npm ci
Drone CI
kind: pipeline
type: docker
name: default
steps:
- name: install
image: node:20
environment:
CHAINSAW_CLIENT_ID:
from_secret: chainsaw_client_id
CHAINSAW_CLIENT_SECRET:
from_secret: chainsaw_client_secret
commands:
- AUTH=$(printf '%s' "$CHAINSAW_CLIENT_ID:$CHAINSAW_CLIENT_SECRET" | base64)
- echo "registry=https://chainsaw.acme.example/repository/@default/npmjs/" >> .npmrc
- echo "//chainsaw.acme.example/repository/@default/npmjs/:_auth=$AUTH" >> .npmrc
- echo "//chainsaw.acme.example/repository/@default/npmjs/:always-auth=true" >> .npmrc
- npm ci