diff --git a/template/Jenkinsfile b/template/Jenkinsfile index ef796ae..d2775b9 100644 --- a/template/Jenkinsfile +++ b/template/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 ''' + export destinationRegistry=`sed -n 's/^destinationRegistry=\\(.*\\)/\\1/p' < config.conf` + export imageName=`sed -n 's/^imageName=\\(.*\\)/\\1/p' < config.conf` + export imageTag=`sed -n 's/^imageTag=\\(.*\\)/\\1/p' < config.conf` + /kaniko/executor --dockerfile `pwd`/Dockerfile --context `pwd` --destination ${destinationRegistry}/${imageName}:${imageTag} + ''' } } } diff --git a/template/setup.sh b/template/setup.sh index dd88cc1..1ecf2a9 100755 --- a/template/setup.sh +++ b/template/setup.sh @@ -21,7 +21,7 @@ rm cicd/Jenkinsfilee echo "" echo "Removing template folder" -# rm -rf template +rm -rf template echo "" echo "Thank you! Happy building..."