Ensure cache invalidation when building CQ pipeline (#753)

master
Christoph Schütte 2018-03-05 08:47:13 +01:00 committed by GitHub
parent 319b60af4c
commit f5efe13c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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. # wstool needs the updated rosinstall file to clone the correct repos.
COPY cartographer_ros.rosinstall cartographer_ros/ COPY cartographer_ros.rosinstall cartographer_ros/
COPY scripts/prepare_jenkins_catkin_workspace.sh cartographer_ros/scripts/ 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 \ RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
cartographer_ros/scripts/prepare_jenkins_catkin_workspace.sh cartographer_ros/scripts/prepare_jenkins_catkin_workspace.sh

2
jenkins/Jenkinsfile vendored
View File

@ -21,7 +21,7 @@ podTemplate(label: 'node-0', containers: [
sh 'gcloud auth activate-service-account --key-file=/opt/config/gcloud-svc-account.json' sh 'gcloud auth activate-service-account --key-file=/opt/config/gcloud-svc-account.json'
sh 'cd /data && rm -Rf *' sh 'cd /data && rm -Rf *'
sh 'cd /data && git clone https://github.com/googlecartographer/cartographer_ros' 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') { stage('Push') {
sh 'docker tag kinetic-jenkins-slave eu.gcr.io/cartographer-141408/kinetic-jenkins-slave' sh 'docker tag kinetic-jenkins-slave eu.gcr.io/cartographer-141408/kinetic-jenkins-slave'