add Jenkinsfile to test each PR and branch commits

This includes a basic test that attempts to compile the rustfmt crate.
Ensures that the workspace is always removed at the end of the build. It
utilizes available caches to speed up the build process and parallelizes
the build across i386, x86_64, arm32, and arm64 targets.

Signed-off-by: Derek Straka <derek@asterius.io>
This commit is contained in:
Derek Straka authored and Doug Goldstein committed 2016-10-31 08:14:53 -05:00
1 parent 9dc57a12be
commit 02b0de534d
5 files changed
+58 -2

No files matched your search

Vendored
+36
View File
@@ -0,0 +1,36 @@
def targets = [ 'qemux86', 'qemux86-64', 'qemuarm', 'qemuarm64' ]
def machine_builds = [:]
for (int i = 0; i < targets.size(); i++) {
def machine = targets.get(i)
machine_builds["$machine"] = {
node {
try {
stage('Checkout') {
checkout scm
}
stage('Setup Environment') {
sh "./scripts/setup-env.sh"
}
stage('Yocto Fetch') {
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh master"
}
stage('Build') {
sh "MACHINE=${machine} ./scripts/build.sh"
}
} catch (e) {
echo "Caught: ${e}"
throw e
} finally {
stage('Cleanup Environment') {
sh "./scripts/cleanup-env.sh"
deleteDir()
}
}
}
}
}
parallel machine_builds