Commit da2963bf authored by NetOps's avatar NetOps
Browse files

Update Jenkinsfile

parent 3ce1f592
No related merge requests found
Showing with 9 additions and 0 deletions
+9 -0
...@@ -10,6 +10,9 @@ node() { ...@@ -10,6 +10,9 @@ node() {
stage('Checkout') { stage('Checkout') {
cleanWs() cleanWs()
checkout scm 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') { stage('docker-pre-build') {
...@@ -38,6 +41,12 @@ node() { ...@@ -38,6 +41,12 @@ node() {
docker rmi -f $docker_server/$docker_repo:$commit_id 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) { catch (err) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment