pipeline制品 archiveArtifacts

脚本

pipeline {
   agent any
options{  timestamps () }
   stages {
      stage('get code ') {        
         steps {
        checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: '[email protected]:newback/dfc.git']]])
            
         }
      }     
stage ('get code-master'){        
  steps {        
      sh '''
 git checkout develop
git pull origin develop
echo "--------------"
go build -o   invoice-srv .  <<<<编译生成出来的包
       '''
 archiveArtifacts(artifacts: 'testProject', onlyIfSuccessful: true)
//archiveArtifacts(artifacts: 'invoice-srv', fingerprint: true)
             }
                 }
                    }
                      }

重要参数

fingerprint: true
onlyIfSuccessful: true

参数详细参考官网

https://www.jenkins.io/doc/pipeline/steps/core/#archiveartifacts-archive-the-artifacts

pipeline制品 archiveArtifacts_第1张图片
可以下载

你可能感兴趣的:(Jenkins)