码迷,mamicode.com
首页 > 其他好文 > 详细

[Jenkins] Define a pipeline

时间:2017-04-24 10:14:01      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:arc   logs   path   技术   hub   idt   height   span   out   

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

标签:arc   logs   path   技术   hub   idt   height   span   out   

原文地址:http://www.cnblogs.com/Answer1215/p/6754997.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!