Jenkins Pipeline Script
作者:互联网
pipeline { agent any parameters { gitParameter branchFilter: 'origin/(.*)', defaultValue: 'master', name: 'BRANCH', type: 'PT_BRANCH' } stages { stage('git') { steps { echo "${params.BRANCH}" git branch: "${params.BRANCH}", url: 'http://ip:port/r/Net.Core.Test.git' } } stage('sonarqube') { steps { echo 'SonarQube Code' } } stage('build') { steps { echo 'dotnet restore' echo 'dotnet build' echo 'dotnet publish' echo 'dotnet publish' } } stage('nexus') { steps { echo "dotnet nexus ${params.BRANCH}" } } } }
以上代码 也可以放到 Jenkinsfile 里面
标签:Pipeline,git,Script,echo,steps,BRANCH,dotnet,Jenkins,stage 来源: https://www.cnblogs.com/valeb/p/16381454.html