jenkins下载地址:Jenkins 的安装和设置
cd xxx/ nohup java -jar jenkins.war >jenkins.log 2>&1 &
二 pipeLine前端流水线构建模板心得:千万不要docker启动Jenkins因为 你可能需要在完成构建后启动 docker
那么就需要在 docker在启动一个docker比较麻烦不建议
node{
// checkout git
stage('git pull'){
checkout([$class: 'GitSCM'
, branches: [[name: '*/master']]
, doGenerateSubmoduleConfigurations: false
, extensions: []
, submoduleCfg: []
, userRemoteConfigs: [[credentialsId: '638d471c-e9de-4420-88df-32a310d3c4c5'
, url: 'https://git.rp-field.com/ai/fe-petpedia-mob.git']]])
}
//npm build
stage('npm build') {
nodejs('NodeJsV14.15.1') {
// npm 编译安装
sh '''
npm config set registry http://registry.npm.taobao.org/''
npm install
npm run build:h5-test
'''
}
}
//docker tag and push harbor
stage('docker镜像启动'){
sh '''
cd docker-test
sh deploy.sh restart
'''
}
}
1.credentialsId:
系统管理>>==>Manage Credentials 唯一ID
2.nodejs 版本
系统管理==>>全局工具配置==>nodejs 别名
如果没有NodeJs 请去插件管理中 安装NodeJs插件



