From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6550672688539500544 X-Received: by 2002:adf:a285:: with SMTP id s5-v6mr2203347wra.8.1525436857412; Fri, 04 May 2018 05:27:37 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:39c1:: with SMTP id g184-v6ls825640wma.9.canary-gmail; Fri, 04 May 2018 05:27:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpAQeQMWtwqPXzFJHyhtooctIDVEzpLRs1AdchzGB3hcAkk+hC1FU5Metoiq+lEwUIvqB2T X-Received: by 10.28.142.199 with SMTP id q190mr2301106wmd.13.1525436856857; Fri, 04 May 2018 05:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525436856; cv=none; d=google.com; s=arc-20160816; b=L0p6elkpuhyUQrGt6BMIjgnDFArF+gYou2cBlgCPMcghGKw1O/9MD1y1+zXas4UcDK ZHad1fHOsm05L/aqnxt2oQv922+4QxaBtqcLJpS+fFg4ci2T5nxmZcxy6xUco+NvjJql 8ObUGUyjLFn5I3UUncS5etoBryBvTWtXUcYrqYh0LIWfIq+0VM1Po6Xy+EvbW1Mz/rbi jB4jz3yKkHPRw1AGoOBMnApMAbmTW8DMg3dr/Q9lYdPFVz7PJnXRd73p95+E8bOoYGDm /hqS6iLUe7BfntGDLaH6xNbUHwX8eKoP6/BbzEWnkX9OTcQ9gNYtAFpYmHMnZ86T1Cjz hn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ABlg/JIwwhMSTJ6myydyqVoDsco+x17Kb/BE7Ux7ekg=; b=Jxq9/68KanPrg4iIws7CxlVtN5qLC7eV3sX8tUSl0f49ph54Dsvt6TYHXGtKTjtXVu 614Asl4SU6xKJ3wwxEJy+f6HlXvsO7l6qXGvBp/dbMwJOJdL7Y3ta+57CZ0iJjq254HQ AIi6PpKwnr+IqQE1CzbQN5rAWPxEKRWZt5WJafRcHB919yLhgnFk07CSC2rrrAbI50QP rFvft4DAkWvhs2KE1aG2JBIMBpnct42kRkwC3QYdEuwdlZfTC9B9i73BX3H83hhnGkUP psLxKeo3RoHbME0MH7S1DUtV9hz1eTs5P+tskPCIwAszejXmTWpQps4DvyPsPMAV3Rsr coqQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id y17-v6si602269wrb.2.2018.05.04.05.27.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 05:27:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from localhost.localdomain ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w44CRLEE030799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 4 May 2018 14:27:29 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH v2 3/3] scripts/ci_build: Make CI script more generic Date: Fri, 4 May 2018 15:27:14 +0300 Message-Id: <20180504122714.1201-4-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180504122714.1201-1-asmirnov@ilbers.de> References: <20180504122714.1201-1-asmirnov@ilbers.de> X-TUID: qWnwM8lGI1k9 Make this script more generic, so it could be used by any CI and by user as well. Also add parameter to specify build folder. Usage: ci_build [-q | -d] -b BUILD_DIR And this command will build all the default Isar images. Signed-off-by: Alexander Smirnov --- scripts/ci_build.sh | 72 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index e941f8c..fec0000 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -1,28 +1,78 @@ -# Script for Jenkins build +# Script for CI system build # # Alexander Smirnov -# Copyright (c) 2016-2017 ilbers GmbH +# Copyright (c) 2016-2018 ilbers GmbH #!/bin/sh +ES_BUG=3 + # Export $PATH to use 'parted' tool export PATH=$PATH:/sbin -# Get parameters from the command line -WORKSPACE=$1 -GIT_COMMIT=$2 - # Go to Isar root cd $(dirname $0)/.. -# Setup build folder for current revision -if [ ! -d /build/$WORKSPACE/$GIT_COMMIT ]; then - mkdir -p /build/$WORKSPACE/$GIT_COMMIT +# Start build in Isar tree by default +BUILD_DIR=./build + +BB_ARGS="-v" + +show_help() { + echo "This script builds all the default Isar images." + echo + echo "Usage:" + echo " $0 [params]" + echo + echo "Parameters:" + echo " -b, --build BUILD_DIR set path to build directory. If not set," + echo " the build will be started in current path." + echo " -d, --debug enable debug bitbake output." + echo " -q, --quite suppress verbose bitbake output." + echo " --help display this message and exit." + echo + echo "Exit status:" + echo " 0 if OK," + echo " 3 if invalid parameters are passed." +} + +# Parse command line to get user configuration +while [ $# -gt 0 ] +do + key="$1" + + case $key in + -h|--help) + show_help + exit 0 + ;; + -b|--build) + BUILD_DIR="$2" + shift + ;; + -d|--debug) + BB_ARGS="$BB_ARGS -d" + ;; + -q|--quite) + BB_ARGS="" + ;; + *) + echo "error: invalid parameter '$key', please try '--help' to get list of supported parameters" + exit $ES_BUG + ;; + esac + + shift +done + +# Setup build folder for the current build +if [ ! -d $BUILD_DIR ]; then + mkdir -p $BUILD_DIR fi -source isar-init-build-env /build/$WORKSPACE/$GIT_COMMIT +source isar-init-build-env $BUILD_DIR # Start build for all possible configurations -bitbake -v \ +bitbake $BB_ARGS \ multiconfig:qemuarm-wheezy:isar-image-base \ multiconfig:qemuarm-jessie:isar-image-base \ multiconfig:qemuarm-stretch:isar-image-base \ -- 2.1.4