Add the ability to use and store build cache artifacts

Signed-off-by: Derek Straka <derek@asterius.io>
(cherry picked from commit 0adcc6e0bc)
This commit is contained in:
Derek Straka
2017-02-14 12:44:11 -05:00
parent 27d1887a1c
commit 699f625a52
3 changed files with 17 additions and 1 deletions

3
Jenkinsfile vendored
View File

@@ -24,6 +24,9 @@ for (int i = 0; i < targets.size(); i++) {
echo "Caught: ${e}"
throw e
} finally {
stage("push build cache $machine") {
sh "./scripts/publish-build-cache.sh master"
}
stage("cleanup $machine") {
sh "./scripts/cleanup-env.sh"
deleteDir()

View File

@@ -220,7 +220,7 @@ BB_DISKMON_DIRS = "\
#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
#file://.* file:///some/local/dir/sstate/PATH"
SSTATE_MIRRORS ?= "file://.* http://build-cache.asterius.io/sstate/PATH;downloadfilename=PATH \n"
SSTATE_MIRRORS ?= "file://.* http://build-cache.asterius.io/master/sstate-cache/PATH;downloadfilename=PATH \n"
SOURCE_MIRROR_URL ?= "http://build-cache.asterius.io/downloads/"
INHERIT += "own-mirrors rm_work"

13
scripts/publish-build-cache.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash -e
if [[ $# -lt 1 ]]; then
echo "No Yocto branch specified, defaulting to master"
echo "To change this pass a Yocto branch name as an argument to this script"
fi
branch=${1-master}
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/downloads yocto-cache@build-cache.asterius.io:/srv/yocto-cache/
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/sstate-cache yocto-cache@build-cache.asterius.io:/srv/yocto-cache/${branch}/
exit 0