[英]building jenkins pipeline in nodejs
我需要實現這個:
pipeline {
agent none
stages {
stage('Build') {
agent {
docker {
image 'python:2-alpine'
}
}
steps {
sh 'python -m py_compile sources/add2vals.py sources/calc.py'
}
}
stage('Test') {
agent {
docker {
image 'qnib/pytest'
}
}
steps {
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
}
post {
always {
junit 'test-reports/results.xml'
}
}
}
}
}
在 nodejs express 項目上並使用 mocha 和 chai 運行單元測試,這是我的代碼:
pipeline {
agent { docker { image 'node:6.3' } }
stages {
stage('build') {
steps {
sh 'npm --version'
}
}
}
}
誰能告訴我該怎么做? 這個例子是 python 所以我不知道我需要做什么。
我會看一下 Jenkins 博客上的資源。 您正在查看的是位於項目目錄根目錄中的 Jenkinsfile。
https://jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.