summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2018-03-14 18:10:48 -0400
committerPeter Jones <pjones@redhat.com>2018-03-14 18:10:48 -0400
commit06ddb2e8f530dcf4155fd5428a924afe4b4c6848 (patch)
tree295a1c2c9f2369cdb4c6e85f7c0d1fe7ada73e73
parent8721bbe6fb1bfdfbc8bd16e05673929e4cbbdedc (diff)
downloadefi-boot-shim-06ddb2e8f530dcf4155fd5428a924afe4b4c6848.tar.gz
efi-boot-shim-06ddb2e8f530dcf4155fd5428a924afe4b4c6848.zip
Add some configs for CI using github+travis+docker
Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--.travis.yml23
-rwxr-xr-xtravis-build.sh61
2 files changed, 84 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..096547f9
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+language: c
+cache: ccache
+branches:
+ except:
+ - travis
+
+matrix:
+ include:
+ - os: linux
+ dist: trusty
+ services: docker
+
+before_install:
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull vathpela/shim-travis-rawhide:v1 ; fi
+
+before_script:
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM vathpela/shim-travis-rawhide:v1 > Dockerfile ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit . ; fi
+
+script:
+ - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run --volume $HOME/.ccache:/root/.ccache withgit /bin/sh -c "cd /root && git pull && git reset origin/master --hard && ./travis-build.sh --branch $TRAVIS_BRANCH --repo \"$TRAVIS_REPO_SLUG\" --remote \"$TRAVIS_PULL_REQUEST_SLUG\" --pr-sha \"$TRAVIS_PULL_REQUEST_SHA\"" ; fi
+ - ccache -s
diff --git a/travis-build.sh b/travis-build.sh
new file mode 100755
index 00000000..f885a9a4
--- /dev/null
+++ b/travis-build.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# travis-build.sh
+# Copyright (C) 2018 Peter Jones <pjones@redhat.com>
+#
+# Distributed under terms of the GPLv3 license.
+#
+#
+
+set -euv
+
+usage() {
+ echo usage: $1 --branch '<origin_branch>' --repo '<origin_repo>' --remote '<remote_repo>' --pr-sha '<commit_id>'
+ exit $2
+}
+
+declare origin_branch=""
+declare origin_repo=""
+declare remote_repo=""
+declare pr_sha=""
+
+let n=0 || :
+
+if [[ $# -le 1 ]] ; then
+ usage $0 1
+fi
+
+while [[ $# > 0 ]] ; do
+ case " $1 " in
+ " --help "|" -h "|" -? ")
+ usage $0 0
+ ;;
+ " --branch ")
+ origin_branch="$2"
+ shift
+ ;;
+ " --repo ")
+ origin_repo="$2"
+ shift
+ ;;
+ " --remote ")
+ remote_repo="$2"
+ shift
+ ;;
+ " --pr-sha ")
+ commit_id="$2"
+ shift
+ ;;
+ *)
+ usage $0 1
+ ;;
+ esac
+ shift
+done
+
+if [[ -n "${remote_repo}" ]] ; then
+ git remote add remote https://github.com/${remote_repo}
+ git fetch remote
+ git checkout -f ${commit_id}
+fi
+make EFIDIR=test ENABLE_SHIM_CERT=1 ENABLE_HTTBOOT=1 ARCH=x86_64 clean all