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.
This commit is contained in:
Bassam Tabbara committed 2017-03-07 01:07:32 -08:00
1 parent 9e1b6c05b2
commit b6991ba441
1 file changed
+7 -9
Vendored
+7 -9
View File
@@ -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') {