From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6550672688539500544 X-Received: by 2002:adf:ec48:: with SMTP id w8-v6mr290724wrn.18.1525197339023; Tue, 01 May 2018 10:55:39 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.13.196 with SMTP id 187ls2036595wmn.2.canary-gmail; Tue, 01 May 2018 10:55:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr64TfOC0XuXU9B66kJPQwYwqP7SZ/6bX3MIs+qor89SKtA0rgovsl3XcynL78mnKABOVJJ X-Received: by 10.28.0.73 with SMTP id 70mr1511485wma.0.1525197338497; Tue, 01 May 2018 10:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525197338; cv=none; d=google.com; s=arc-20160816; b=NFIpNLhtefqmga0S7nSl8HCNv8hbAldu9qA2sBk8Mj7Op7OpoBwEiDhYe8EVPHn4v7 nJWzusspDNU1IkI5wJatzwrxbTFV2/xZ9e0ravMkcI9ziJRXuqehkFYKGDTmO0sOH+e9 Vbsunu2AGPzFwLffnq141u0+KaW2MFOC56sY1VpxujjLMsch69qMnPuumI2AJOZ8khsm pmMV9xmt1JGWV1WgeTON2o3YCexlqSGl1fQvI2bvDWmCJnoTgoMySfam42WKdldP7DZV 7MNykNgwVNrMGmgkVMCGgP1//xqs1r1N+Cnkcf+3GUGCIb8wXW5KtWLOk5eGQ7qiLLWN JTlQ== 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=NMHcbO17BLYEx2noo5Mn/9F4aT1Sjx83cV3iwt/vuvU=; b=yuy//cL2wKLSifzNXN54fEWv0hAzJkSAcpXPGVg5IuofbLjK/hFIDPlamGQRetvlI0 TsROyOWMts4o9C/+1Sesnw7VespKy15LtSi4Ak/3HvjBJVG0476QKEdT8nenSKBslTcJ zqlFFsysAI49Bnhz4iH65NAuTMJvvSrnrUSsKoiOViaRakhFMWoIjXx4P1KKI6FvnJij wqd0ASGWSKIMt7aqDvdPYyCBXXZ0GPBwQ31xnGvJIJ0r8/BG4Cm7m4tgqAULTWb7/YLV uCDyZ34XzfGFtv2AYAEJBCEA2O5KjFGH3Cxfx2j8cJlp+kjrUoFPll3keonF1DGV+kOp DgZQ== 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 y144si412912wmd.3.2018.05.01.10.55.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 10:55:38 -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 w41HtMBk019597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 1 May 2018 19:55:30 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH 3/3] scripts/ci_build: Make CI script more generic Date: Tue, 1 May 2018 20:55:11 +0300 Message-Id: <20180501175511.26145-4-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180501175511.26145-1-asmirnov@ilbers.de> References: <20180501175511.26145-1-asmirnov@ilbers.de> X-TUID: 0L3d8ir+uI9R 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 [-v] -b BUILD_DIR And this command will build all the default Isar images. Signed-off-by: Alexander Smirnov --- scripts/ci_build.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index e941f8c..6b5871e 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -1,28 +1,72 @@ -# 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 + +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 " -v, --verbose set verbose level of 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 + ;; + -v|--verbose) + BB_ARGS="$BB_ARGS -v" + ;; + *) + 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