From 20fa8480769362776f3b1df0853206cfc7a00483 Mon Sep 17 00:00:00 2001 From: Lei Wang Date: Thu, 3 May 2018 14:53:12 -0700 Subject: [PATCH] Travis: using ccache for docker build. --- .travis.yml | 22 +--------------------- paddle/scripts/paddle_docker_build.sh | 4 ++++ 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe4eb2d157..3391e2c3ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,34 +16,14 @@ env: - JOB=check_style - JOB=build_android addons: - apt: - packages: - - gcc-4.8 - - g++-4.8 - - git - - build-essential - - python - - python-pip - - python2.7-dev - - python-wheel - - libboost-dev - - curl - - swig - - graphviz - - clang-format-3.8 - - automake - - libtool - - ccache ssh_known_hosts: 13.229.163.131 before_install: - - sudo pip install -r $TRAVIS_BUILD_DIR/python/requirements.txt - - sudo pip install wheel sphinx==1.5.6 recommonmark sphinx-rtd-theme==0.1.9 virtualenv pre-commit - | function timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } script: - | # 43min timeout - if [[ "$JOB" != "doc" ]]; then timeout 2580 paddle/scripts/paddle_docker_build.sh ${JOB}; else paddle/scripts/paddle_build.sh ${JOB}; fi; + paddle/scripts/paddle_docker_build.sh ${JOB} if [ $? -eq 0 ] || [ $? -eq 142 ]; then true; else exit 1; fi; - | if [[ "$JOB" != "doc" ]]; then exit 0; fi; diff --git a/paddle/scripts/paddle_docker_build.sh b/paddle/scripts/paddle_docker_build.sh index 311eb57601..ddae9f19a2 100755 --- a/paddle/scripts/paddle_docker_build.sh +++ b/paddle/scripts/paddle_docker_build.sh @@ -56,11 +56,15 @@ EOL if ! [ -x "$(command -v ${DOCKER_CMD})" ]; then DOCKER_CMD="docker" fi + if [ ! -d "${HOME}/.ccache" ]; then + mkdir ${HOME}/.ccache + fi set -x ${DOCKER_CMD} run -it \ --name $CONTAINER_ID \ ${DOCKER_ENV} \ -v $PADDLE_ROOT:/paddle \ + -v ${HOME}/.ccache:/root/.ccache \ -w /paddle \ $IMG \ paddle/scripts/paddle_build.sh $@ -- GitLab