pipeline { agent { label 'ubuntu' } stages { stage('拉取代码') { steps { checkout scmGit(branches: [[name: 'main']], extensions: [submodule(depth: 1, parentCredentials: true, recursiveSubmodules: true, reference: '', shallow: true), lfs()], userRemoteConfigs: [[credentialsId: 'gitlab-http', url: 'http://gitlab-soa/gitlab-instance-ad96d090/test_demo']]) } } stage('maven构建') { steps { script { sh '''set +x mvn clean package -Dmaven.test.skip=true -U ''' } } } stage('制品上传') { steps { script { if (!fileExists('target/demo-0.0.1-SNAPSHOT.jar')) {error 'target/demo-0.0.1-SNAPSHOT.jar no exist'} } script { sh '''set +x mc config host add minio http://192.26.193.11:32657 admin 123456 mc mb minio/537b1da2-f3ba-4e20-a646-b49f4ac31ad8-11-14 mc cp target/demo-0.0.1-SNAPSHOT.jar minio/537b1da2-f3ba-4e20-a646-b49f4ac31ad8-11-14 #DEPEND_SWTICH# ''' } } } } post { always { cleanWs() } } options { timeout(time: 1200, unit: 'MINUTES') } }
标签:pipeline,上传,minio,script,demo,jar,拉取,0.0,true From: https://www.cnblogs.com/goPush/p/18082772