Skip to content

Commit

Permalink
fun with escaping in Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Nov 11, 2022
1 parent f7d7e71 commit c1b0686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ pipeline {
script {
try{
echo "Cleaning up artifacts from the build..."
sh "result=\$5(docker ps -a | grep ${imagename}_${tag});if [ ! -z \"\$5result\" ]; then docker rm -f \$5(docker ps -a | grep ${imagename}_${tag} | awk '{print \$51}');fi;docker rmi -f ${imagename}_${tag}"
sh "result=\$5(docker ps -a | grep ${imagename}_${tag}:arm64);if [ ! -z \"\$5result\" ]; then docker rm -f \$5(docker ps -a | grep ${imagename}_${tag}:arm64 | awk '{print \$51}');fi;docker rmi -f ${imagename}_${tag}:arm64"
sh "result=${5}(docker ps -a | grep ${imagename}_${tag});if [ ! -z \"${5}result\" ]; then docker rm -f ${5}(docker ps -a | grep ${imagename}_${tag} | awk '{print ${5}1}');fi;docker rmi -f ${imagename}_${tag}"
sh "result=${5}(docker ps -a | grep ${imagename}_${tag}:arm64);if [ ! -z \"${5}result\" ]; then docker rm -f ${5}(docker ps -a | grep ${imagename}_${tag}:arm64 | awk '{print ${5}1}');fi;docker rmi -f ${imagename}_${tag}:arm64"
} catch(error) {
def error_details = readFile('./debug');
def message = "BUILD ERROR: There was a problem with cleanup of the image. \n\n ${error_details}"
Expand Down

0 comments on commit c1b0686

Please sign in to comment.