首页 > 代码库 > [Jenkins] Define a pipeline

[Jenkins] Define a pipeline

node{    stage checkout    git [github_url]        def project_path="[project_path]"        // everythin in dir block will based on project bath     dir(proejct_path) {                stage compiling, test, packing        sh mvn clean package                stage archival        step([            $class: ArtifcatArchiver,            artifacts: "target/*.jar",            excludes: null            ])    }}

 

Add ‘stage‘ which we can know what is the progress in a high level way:

技术分享

 

‘sh‘ is for any shell commands.

Pipeline is written in Rudy, so can use rudy syntax to def a variable.

[Jenkins] Define a pipeline