Fix the image name in the shell commands.

This commit is contained in:
Andrea Dell'Amico 2024-04-16 19:21:47 +02:00
parent 33797272d0
commit d3886c4fa9
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 4 additions and 3 deletions

View File

@ -10,6 +10,7 @@ pipeline {
} }
environment { environment {
imagename = "rstudio/rstudio-wb3-ecosystem" imagename = "rstudio/rstudio-wb3-ecosystem"
hubname = "hub.dev.d4science.org"
registryUrl = "https://hub.dev.d4science.org" registryUrl = "https://hub.dev.d4science.org"
registryCredential = 'cccd3cf5-9d6c-4044-85d6-59bede0c43f4' registryCredential = 'cccd3cf5-9d6c-4044-85d6-59bede0c43f4'
dockerImage = '' dockerImage = ''
@ -31,7 +32,7 @@ pipeline {
stage('Deploy Image') { stage('Deploy Image') {
steps{ steps{
script { script {
docker.withRegistry( 'https://hub.dev.d4science.org', registryCredential ) { docker.withRegistry( registryUrl, registryCredential ) {
dockerImage.push("$BUILD_NUMBER") dockerImage.push("$BUILD_NUMBER")
dockerImage.push('wb3-ecosystem') dockerImage.push('wb3-ecosystem')
} }
@ -40,8 +41,8 @@ pipeline {
} }
stage('Remove Unused docker image') { stage('Remove Unused docker image') {
steps{ steps{
sh "docker rmi $imagename:$BUILD_NUMBER" sh "docker rmi $hubname/$imagename:$BUILD_NUMBER"
sh "docker rmi $imagename:wb3-ecosystem" sh "docker rmi $hubname/$imagename:wb3-ecosystem"
} }
} }