diff --git a/Jenkinsfile b/Jenkinsfile index 3b0e0eba3f70082232f960212df0b0ea6c88a11b..fa04149c141661d8aaf0a1a4a70f4592f89a363e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,6 +10,9 @@ node() { stage('Checkout') { cleanWs() checkout scm + commit_hash = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() + env.commit_id = sh(script: "echo " + "form" + "_" + commit_hash + "_" + env.BUILD_NUMBER, returnStdout: true).trim() + echo "${env.commit_id}" } } stage('docker-pre-build') { @@ -38,6 +41,12 @@ node() { docker rmi -f $docker_server/$docker_repo:$commit_id ''' } + stage('ArchiveArtifacts') { + sh ("echo ${commit_id} > commit_id.txt") + archiveArtifacts "commit_id.txt" + currentBuild.description = "${commit_id}" + } + } catch (err) {