mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Merge pull request #271 from AikidoSec/feature/jenkins
This commit is contained in:
commit
acb4aa1a13
1 changed files with 40 additions and 0 deletions
40
README.md
40
README.md
|
|
@ -237,6 +237,7 @@ iex "& { $(iwr 'https://github.com/AikidoSec/safe-chain/releases/latest/download
|
||||||
- ✅ **GitHub Actions**
|
- ✅ **GitHub Actions**
|
||||||
- ✅ **Azure Pipelines**
|
- ✅ **Azure Pipelines**
|
||||||
- ✅ **CircleCI**
|
- ✅ **CircleCI**
|
||||||
|
- ✅ **Jenkins**
|
||||||
|
|
||||||
## GitHub Actions Example
|
## GitHub Actions Example
|
||||||
|
|
||||||
|
|
@ -288,4 +289,43 @@ workflows:
|
||||||
- build
|
- build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Jenkins Example
|
||||||
|
|
||||||
|
Note: This assumes Node.js and npm are installed on the Jenkins agent.
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
// Jenkins does not automatically persist PATH updates from setup-ci,
|
||||||
|
// so add the shims + binary directory explicitly for all stages.
|
||||||
|
PATH = "${env.HOME}/.safe-chain/shims:${env.HOME}/.safe-chain/bin:${env.PATH}"
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Install safe-chain') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Install Safe Chain for CI
|
||||||
|
curl -fsSL https://github.com/AikidoSec/safe-chain/releases/latest/download/install-safe-chain.sh | sh -s -- --ci
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Install project dependencies etc...') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
set -euo pipefail
|
||||||
|
npm ci
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
After setup, all subsequent package manager commands in your CI pipeline will automatically be protected by Aikido Safe Chain's malware detection.
|
After setup, all subsequent package manager commands in your CI pipeline will automatically be protected by Aikido Safe Chain's malware detection.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue