From f5efe13c8a9720c4840b42673db53e032553c736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Sch=C3=BCtte?= Date: Mon, 5 Mar 2018 08:47:13 +0100 Subject: [PATCH] Ensure cache invalidation when building CQ pipeline (#753) --- jenkins/Dockerfile.kinetic | 3 +++ jenkins/Jenkinsfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/jenkins/Dockerfile.kinetic b/jenkins/Dockerfile.kinetic index d2cc9ba..227aa79 100644 --- a/jenkins/Dockerfile.kinetic +++ b/jenkins/Dockerfile.kinetic @@ -27,6 +27,9 @@ ADD https://api.github.com/repos/googlecartographer/cartographer/git/refs/heads/ # wstool needs the updated rosinstall file to clone the correct repos. COPY cartographer_ros.rosinstall cartographer_ros/ COPY scripts/prepare_jenkins_catkin_workspace.sh cartographer_ros/scripts/ + +# Invalidates the Docker cache to ensure this command is always executed. +ARG CACHEBUST=1 RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \ cartographer_ros/scripts/prepare_jenkins_catkin_workspace.sh diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index 9f835ae..06bb2fc 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -21,7 +21,7 @@ podTemplate(label: 'node-0', containers: [ sh 'gcloud auth activate-service-account --key-file=/opt/config/gcloud-svc-account.json' sh 'cd /data && rm -Rf *' sh 'cd /data && git clone https://github.com/googlecartographer/cartographer_ros' - sh 'cd /data/cartographer_ros && docker build -f jenkins/Dockerfile.kinetic -t kinetic-jenkins-slave .' + sh 'cd /data/cartographer_ros && docker build -f jenkins/Dockerfile.kinetic -t kinetic-jenkins-slave --build-arg CACHEBUST=$(date +%s) .' } stage('Push') { sh 'docker tag kinetic-jenkins-slave eu.gcr.io/cartographer-141408/kinetic-jenkins-slave'