From d434632d94795237018925908a3900a583608197 Mon Sep 17 00:00:00 2001 From: "dmitry.kirdyashkin" Date: Sun, 18 Dec 2022 23:58:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=B9=D0=BF=D0=BB=D0=B0=D0=B9=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e3f2a21..8ce5cc4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,12 +1,53 @@ pipeline { agent any + environment { + VERSION_STR = "$BUILD_NUMBER" + DOWNLOAD_STR = "http://192.168.1.200:8082/repository/zip-repo/shared-compendia/${BUILD_NUMBER}/shared-compendia-${BUILD_NUMBER}.zip" + } + stages { - stage('test') { + stage('modifying module.json') { steps { - sh '/bin/true' - sh 'ls -la' + sh "sed -i 's_\"version\":.*\$_\"version\": \"${BUILD_NUMBER}\",_;s_\"download\":.*\$_\"download\": \"${DOWNLOAD_STR}\",_' module.json" + } + } + stage('copy module.json') { + steps { + sh "cp -f module.json src/module.json" + } + } + stage('archive artifacts') { + steps { + archiveArtifacts artifacts: 'module.json', fingerprint: true + } + } + stage('generate archive') { + steps { + zip zipFile: "shared-compendia-${BUILD_NUMBER}.zip", archive: false, overwrite: true, dir: "src" + } + } + stage('upload artifact') { + steps { + nexusArtifactUploader ( + artifacts: [ + [ + artifactId: "shared-compendia", + classifier: '', + file: "shared-compendia-${BUILD_NUMBER}.zip", + type: 'zip' + ] + ], + credentialsId: '190405b3-4cdf-4475-85ed-a3a7713cb6eb', + groupId: 'shared-compendia', + nexusUrl: '192.168.1.200:8082', + nexusVersion: 'nexus3', + protocol: 'http', + repository: 'zip-repo', + version: '$BUILD_NUMBER' + ) + sh 'curl --user jenkins:12345678 --upload-file module.json http://192.168.1.200:8082/repository/zip-repo/shared-compendia/module.json' } } } -} \ No newline at end of file +}