Jenkinsfile: correct the branch and docker tag

This commit is contained in:
Andrea Dell'Amico 2023-04-11 16:12:30 +02:00
parent 65294a8a27
commit ecab2fcfa9
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 8 additions and 10 deletions

18
Jenkinsfile vendored
View File

@ -12,15 +12,14 @@ pipeline {
imagename = "d4science/r-studio-test" imagename = "d4science/r-studio-test"
registryCredential = 'e348bfab-5580-4db6-b0e0-d854966bde08' registryCredential = 'e348bfab-5580-4db6-b0e0-d854966bde08'
dockerImage = '' dockerImage = ''
git_url='https://code-repo.d4science.org/gCubeSystem/r-studio-test.git' git_url='https://code-repo.d4science.org/gCubeSystem/rstudio-d4science.git'
} }
stages { stages {
stage('Cloning Git') { // stage('Cloning Git') {
steps { // steps {
git([url: git_url, branch: 'master', credentialsId: '88b54962-1c0e-49cb-8155-22276860f346']) // git([url: git_url, branch: '2023-03-R4-2', credentialsId: '88b54962-1c0e-49cb-8155-22276860f346'])
// }
} // }
}
stage('Building image') { stage('Building image') {
steps{ steps{
script { script {
@ -33,8 +32,7 @@ pipeline {
script { script {
docker.withRegistry( '', registryCredential ) { docker.withRegistry( '', registryCredential ) {
dockerImage.push("$BUILD_NUMBER") dockerImage.push("$BUILD_NUMBER")
dockerImage.push('latest') dockerImage.push('2023-03-R4-2')
} }
} }
} }
@ -42,7 +40,7 @@ pipeline {
stage('Remove Unused docker image') { stage('Remove Unused docker image') {
steps{ steps{
sh "docker rmi $imagename:$BUILD_NUMBER" sh "docker rmi $imagename:$BUILD_NUMBER"
sh "docker rmi $imagename:latest" sh "docker rmi $imagename:2023-03-R4-2"
} }
} }