Commit cd53dc0d authored by nivetha's avatar nivetha
Browse files

Merge branch 'master' of https://git.idc.tarento.com/smf/smf-user

Showing with 9 additions and 4 deletions
+9 -4
......@@ -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 " + "user" + "_" + commit_hash + "_" + env.BUILD_NUMBER, returnStdout: true).trim()
echo "${env.commit_id}"
}
}
stage('docker-pre-build') {
......@@ -24,20 +27,22 @@ node() {
stage('docker-build') {
sh '''
commit_id=$(git rev-parse --short HEAD)
echo $commit_id> commit_id.txt
docker build --no-cache -f Dockerfile -t $docker_server/$docker_repo:$commit_id .
'''
}
stage('docker-push') {
sh '''
pwd
commit_id=$(git rev-parse --short HEAD)
docker push $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) {
......
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