From e5fb35eb200e3476297ba3f0465775a05fb86e86 Mon Sep 17 00:00:00 2001 From: Jan-Simon Möller Date: Tue, 23 May 2017 14:39:21 +0200 Subject: Add initial job template for application builds within jenkins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds the necessary plumbing to build applications for the 3-4 different target architectures for applications within jenkins as CI builds. Change-Id: I263c3ba25fa6dbea78d305ff453cca1106724316 Signed-off-by: Jan-Simon Möller --- jjb/common/include-apps-header.sh | 128 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 jjb/common/include-apps-header.sh (limited to 'jjb/common/include-apps-header.sh') diff --git a/jjb/common/include-apps-header.sh b/jjb/common/include-apps-header.sh new file mode 100644 index 00000000..7c60b1af --- /dev/null +++ b/jjb/common/include-apps-header.sh @@ -0,0 +1,128 @@ +#!/bin/bash +# (c) 2017 Jan-Simon Moeller dl9pf(at)gmx.de +# License GPLv2 +# +# debugging purposes +set -e + +################################################################################ +## Header +################################################################################ + + +# VARIABLES +OPTIND=1 +#export DLHOST="http://download.automotivelinux.org/" +# DLHOST in auto.conf +export NOGFX=false +export VERBOSE=false +export DEBUG=false +function vprint() { + : +} +function dprint() { + : +} + +#export TARGETARCHALL="arm aarch64 x86-64" + +if test x"" = x"${architecture}"; then + export TARGETARCH="arm" +else + export TARGETARCH="${architecture}" +fi + +# finally cmdline arguments +while getopts ":b:a:p:r:dvx" opt; do + case "$opt" in + b) + export TARGETBRANCH="$OPTARG" + ;; + d) + DEBUG=true + function dprint() { + echo "DEBUG: $@" + } + ;; + p) + export TARGETPROJECT="$OPTARG" + ;; + a) + export TARGETARCH="arm" + ;; + r) + export TARGETREFSPEC="$OPTARG" + ;; + v) + VERBOSE=true + function vprint() { + echo "VERBOSE: \"$@\"" + } + ;; + x) + set -x + ;; + h|\?) + echo "$0 [-h/-?] -bdinpqrvx" + echo "--------------------------------------------------------------------------------" + echo " -b - name of the branch to use (default=master)" + echo " -d - debug" + echo " -a - arch" + echo " one of:" + echo " -- arm" + echo " -- x86-64" + echo " -- aarch64" + echo " -p - project to use (default=AGL/AGL-repo)" + echo " -r - 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 + +if test ! -f ~/.gitconfig ; then + git config --global user.email "jenkins-dontreply@build.automotivelinux.org" + git config --global user.name "jenkins-dontreply@build.automotivelinux.org" +fi + +##### map architecture to a machine SDK (until we have generic SDKs) ######### + +if test x"" = x"$TARGETARCH" ; then + echo "No TARGETARCH variable. Exiting." + exit 1 +fi + +case "$TARGETARCH" in + arm) + export TARGETSDKARCH="armv7vehf-neon-vfpv4" + export TARGETSDKMACHINE="raspberrypi3" + ;; + x86-64) + export TARGETSDKARCH="corei7-64" + export TARGETSDKMACHINE="intel-corei7-64" + ;; + aarch64) + export TARGETSDKARCH="aarch64" + export TARGETSDKMACHINE="dragonboard-410c" + ;; +esac + +# failsafe +if test x"" = x"$TARGETSDKARCH" ; then + echo "No TARGETSDKARCH variable. Exiting." + exit 1 +fi +# failsafe +if test x"" = x"$TARGETSDKMACHINE" ; then + echo "No TARGETSDKMACHINE variable. Exiting." + exit 1 +fi -- cgit 1.2.3-korg