From b6991ba441adbcff450ebc5ce3b8c24c2d75f0cb Mon Sep 17 00:00:00 2001 From: Bassam Tabbara Date: Tue, 7 Mar 2017 00:03:02 -0800 Subject: [PATCH] build: add ccache max size to Jenkinsfile also move the ccache director to the standard .ccache and print the ccache stats before and after the build. --- Jenkinsfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5de037168..7f5afd385 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,19 +4,15 @@ try { // if you are building this in a forked repo please change/remove the node specification to suit your Jenkins setup node("ec2-stateful") { // this count is meant to be optimal for the AWS EC2 c4.4xlarge instance type, adjust accordingly for the build host - def parallel + def parallel = '12' // a ccache location is not required, but if is used it will accelerate successive builds - def CCACHE_DIR - // this parameter controls the tag used on the output container - def VERSION + def CCACHE_DIR = '~/.ccache' // this parameter is used only as an override to build specific commits when debugging def sha1 stage('Preparation') { - parallel = '12' - CCACHE_DIR = '~/ccache' - VERSION = 'dev' sh "mkdir -p ${CCACHE_DIR}" + writeFile file: "${CCACHE_DIR}/ccache.conf", text: "max_size = 20G" checkout scm sh "git submodule sync --recursive" sh "git submodule update --init --recursive" @@ -24,11 +20,13 @@ try { } stage('Build') { - sh "CCACHE_DIR=${CCACHE_DIR} VERSION=${VERSION} build/run make -j${parallel} release" + sh "CCACHE_DIR=${CCACHE_DIR} build/run ccache -s" + sh "CCACHE_DIR=${CCACHE_DIR} build/run make -j${parallel} release" + sh "CCACHE_DIR=${CCACHE_DIR} build/run ccache -s" } stage('Unit Tests') { - sh "CCACHE_DIR=${CCACHE_DIR} VERSION=${VERSION} build/run make -j${parallel} check" + sh "CCACHE_DIR=${CCACHE_DIR} build/run make -j${parallel} check" } stage('Results') {