From 0f327f87ca353063d64d719d05b442d657b9ba52 Mon Sep 17 00:00:00 2001 From: birdstorm Date: Tue, 14 May 2019 17:54:48 +0800 Subject: [PATCH] Make CI use maven m2 cache instead of downloading (#720) --- .ci/build.groovy | 4 ++++ .ci/integration_test.groovy | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.ci/build.groovy b/.ci/build.groovy index a7c7a0c8e5..b6b0ada332 100644 --- a/.ci/build.groovy +++ b/.ci/build.groovy @@ -12,6 +12,10 @@ def call(ghprbActualCommit, ghprbPullId, ghprbPullTitle, ghprbPullLink, ghprbPul container("java") { stage('Checkout') { dir("/home/jenkins/git/tispark") { + sh """ + archive_url=http://172.16.30.25/download/builds/pingcap/tiflash/cache/tiflash-m2-cache_latest.tar.gz + if [ ! "\$(ls -A /maven/.m2/repository)" ]; then curl -sL \$archive_url | tar -zx -C /maven || true; fi + """ if (sh(returnStatus: true, script: '[ -d .git ] && [ -f Makefile ] && git rev-parse --git-dir > /dev/null 2>&1') != 0) { deleteDir() } diff --git a/.ci/integration_test.groovy b/.ci/integration_test.groovy index b492abbd76..baa26cc76f 100644 --- a/.ci/integration_test.groovy +++ b/.ci/integration_test.groovy @@ -86,6 +86,10 @@ def call(ghprbActualCommit, ghprbCommentBody, ghprbPullId, ghprbPullTitle, ghprb dir("go/src/github.com/pingcap/tispark") { deleteDir() sh """ + archive_url=http://172.16.30.25/download/builds/pingcap/tiflash/cache/tiflash-m2-cache_latest.tar.gz + if [ ! "\$(ls -A /maven/.m2/repository)" ]; then curl -sL \$archive_url | tar -zx -C /maven || true; fi + """ + sh """ cp -R /home/jenkins/git/tispark/. ./ git checkout -f ${ghprbActualCommit} find core/src -name '*Suite*' > test