diff options
author | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2016-11-07 12:37:23 +0100 |
---|---|---|
committer | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2016-11-07 12:49:16 +0100 |
commit | cf00e8181097e32ff40dd69e1c15d7a0c9ea3a40 (patch) | |
tree | 27895a535feac0b6aaf0fbcedb6d85148c479410 /jjb/common/include-agl-header.sh | |
parent | cb44fe25cc827eeb23a5681f2b34e66066644b0b (diff) |
Add generic jjb CI job for AGL
Change-Id: I8264fd08a6ea2348751c1c7ed15da1103fbf4272
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'jjb/common/include-agl-header.sh')
-rw-r--r-- | jjb/common/include-agl-header.sh | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/jjb/common/include-agl-header.sh b/jjb/common/include-agl-header.sh new file mode 100644 index 00000000..62dd6445 --- /dev/null +++ b/jjb/common/include-agl-header.sh @@ -0,0 +1,132 @@ +#!/bin/bash +# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de +# License GPLv2 +# +# debugging purposes +set -e + +################################################################################ +## HEADER +################################################################################ + + +# VARIABLES +OPTIND=1 +export DLHOST="https://download-new.automotivelinux.org/" +export NOGFX=false +export VERBOSE=false +export DEBUG=false +function vprint() { + : +} +function dprint() { + : +} + +# defaults for project, branch, refspec +export TARGETPROJECT="AGL/AGL-repo" +export TARGETBRANCH="master" +export TARGETREFSPEC="refs/heads/master" + +export TARGETFEATURESnogfx="agl-appfw-smack agl-netboot agl-sota agl-devel" +export TARGETFEATURES="agl-demo ${TARGETFEATURESnogfx}" + +export TARGETQA="" +export TARGETIMAGE="agl-demo-platform\${TARGETQA}" +export TARGETIMAGEnogfx="agl-image-ivi\${TARGETQA}" + +export TARGETSDK="populate_sdk" + +# apply GERRIT_* +if test -n "${GERRIT_PROJECT}"; then +export TARGETPROJECT="${GERRIT_PROJECT}" +fi +if test -n "${GERRIT_BRANCH}"; then + export TARGETBRANCH="${GERRIT_BRANCH}" +fi +if test -n "${GERRIT_REFSPEC}"; then +export TARGETREFSPEC="${GERRIT_REFSPEC}" +fi + +if test x"" = x"${MACHINE}"; then + export MACHINE="qemux86-64" +fi + +# finally cmdline arguments +while getopts ":b:i:p:r:dnqvx" opt; do + case "$opt" in + b) + export TARGETBRANCH="$OPTARG" + ;; + d) + DEBUG=true + function dprint() { + echo "DEBUG: $@" + } + ;; + i) + export TARGETIMAGE="$OPTARG" + ;; + n) + export NOGFX=true + ;; + p) + export TARGETPROJECT="$OPTARG" + ;; + q) + export TARGETQA="-qa" + ;; + r) + export TARGETREFSPEC="$OPTARG" + ;; + v) + VERBOSE=true + function vprint() { + echo "VERBOSE: \"$@\"" + } + ;; + x) + set -x + ;; + h|\?) + echo "$0 [-h/-?] -bdinpqrvx" + echo "--------------------------------------------------------------------------------" + echo " -b <branch> - name of the branch to use (default=master)" + echo " -d - debug" + echo " -i <image> - name of the image to build (default=agl-demo-platform)" + echo " -n - no graphics (no wayland, aka no drivers)" + echo " -p <project> - project to use (default=AGL/AGL-repo)" + echo " -q - build '*-qa' images (default='')" + echo " -r <refspec> - refspec to use (default=refs/heads/master)" + echo " -v - verbose" + echo " -x - set -x" + echo "--------------------------------------------------------------------------------" + echo " GERRIT_PROJECT, GERRIT_BRANCH, GERRIT_REFSPEC are used if present," + echo " but cmdline arguments take precedence." + echo "--------------------------------------------------------------------------------" + exit 1 + ;; + :) + echo "Option -$OPTARG required an argument." + exit 1 + ;; + esac +done + +# expand +eval TARGETIMAGE="$TARGETIMAGE" +eval TARGETIMAGEnogfx="$TARGETIMAGEnogfx" + +if $NOGFX; then + export TARGETIMAGE=${TARGETIMAGEnogfx} +fi +if test x"porter-nogfx" = x"$MACHINE"; then + export TARGETIMAGE=${TARGETIMAGEnogfx} +fi + +#if $DEBUG; then +set | grep ^TARGET || true +set | grep ^GERRIT || true +set | grep ^MACHINE || true +#fi + |