From d5abac431322436f5eabec1da48f64100d88bc1f Mon Sep 17 00:00:00 2001 From: Sciocatti Date: Wed, 11 Jan 2023 23:51:42 +0200 Subject: [PATCH] Modified sh script to be one step. --- cicd/Jenkinsfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cicd/Jenkinsfile b/cicd/Jenkinsfile index ecafa11..22118ed 100644 --- a/cicd/Jenkinsfile +++ b/cicd/Jenkinsfile @@ -36,10 +36,12 @@ spec: stage('Docker Build and Push') { steps { container("kaniko") { - sh 'destinationRegistry=`sed -n \'s/^destinationRegistry=\\(.*\\)/\\1/p\' < config.conf`' - sh 'imageName=`sed -n \'s/^imageName=\\(.*\\)/\\1/p\' < config.conf`' - sh 'imageTag=`sed -n \'s/^imageTag=\\(.*\\)/\\1/p\' < config.conf`' - sh '/kaniko/executor --dockerfile `pwd`/Dockerfile --context `pwd` --destination ${destinationRegistry}/${imageName}:${imageTag}' + sh """ + destinationRegistry=`sed -n 's/^destinationRegistry=\\(.*\\)/\\1/p' < config.conf` + imageName=`sed -n 's/^imageName=\\(.*\\)/\\1/p' < config.conf` + imageTag=`sed -n 's/^imageTag=\\(.*\\)/\\1/p' < config.conf` + /kaniko/executor --dockerfile `pwd`/Dockerfile --context `pwd` --destination $destinationRegistry/$imageName:$imageTag + """ } } }