Jenkins CI
Environment variables
Node.js project configuration
Jenkinsfile (Declarative Pipeline) configuration for a Node.js job
Jenkinsfile (Declarative Pipeline) configuration for a Node.js job// The release stage in the pipeline will run only if the test stage in the pipeline is successful
pipeline {
agent any
environment {
GH_TOKEN = credentials('some-id')
}
stages {
stage('Test') {
steps {
sh '''
# Configure your test steps here (checkout, npm install, tests etc)
npm install
npm test
'''
}
}
stage('Release') {
tools {
nodejs "node LTS"
}
steps {
sh '''
# Run optional required steps before releasing
npx semantic-release
'''
}
}
}
}package.json configuration for a Node job
package.json configuration for a Node jobLast updated
Was this helpful?