From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44])
 by dpdk.org (Postfix) with ESMTP id 7CC612A5D
 for <ci@dpdk.org>; Thu, 15 Dec 2016 00:05:32 +0100 (CET)
Received: by mail-wm0-f44.google.com with SMTP id a197so136965528wmd.0
 for <ci@dpdk.org>; Wed, 14 Dec 2016 15:05:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:subject:date:message-id:in-reply-to:references;
 bh=QW5mZ6wR9ImUfzcRW1NhwiifXBLeEkluWVPA3/L86gw=;
 b=jBoZ27PPt01sBS63mxKHjaYNnrWH/YuRPiLtvRkpnXWSr9SiqxmwhdiqCwj8rsMw3J
 8JgpmRPJIPMRyFWs18c+pFj2Ah/1JOZc/MqM08Ksmgd6c1kSM2zjpYjRgo7mk5N2SIJy
 2dD7Gz9QDYVhBxxYD4noKIEAhrbCKYszKVjhyI2jbXe5cn6o7RVkFcpGn5vpxgHnZYsS
 U5Tl3f603BauDB4I1i9n/kGZS16o36AzpPMfVWMDnZpWKFhOG8MSllBLHi6TW+RoNF4q
 APeLqoMH9EvYRXdFRnnzm03W9gDLVVpErb2Jok8CyEddAnXuc7P5IMeZi/Qwbp/6pcuE
 d8cA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
 :references;
 bh=QW5mZ6wR9ImUfzcRW1NhwiifXBLeEkluWVPA3/L86gw=;
 b=Jhje/4w4AM/GF7qcQWPT9bq0A4J5hmVPP94nUvFB59PIsxF4WKuxmJyxxO33WlH5Hl
 M3OEXoyNOmUDsamftaaAoy+iGx1emdV7QwT06coq6KJ2GPM6X8nc8UFeixMmoJa+fP/2
 tnoK+/wVxPZYfq2iClm3ETHyOJkEY7Gx876V2ONRJ1HRkCOkbd5/kejqKNz1O4tNlZVJ
 onHM7Fc6x2sKaMb7SlDWU4LrqTkYGdvltzIJjOFKk7URsYBiwMb14EjJZOweO9R0nxs0
 5fLLzP+QQqcWHpUyldDCwn2chp+NvYnDgHhEtlROqSWSA4JkZE+v38pmK5VGZiyXg9fQ
 D28A==
X-Gm-Message-State: AKaTC01Im6Cvi9X06d7/8NkRW/8dLS1qpohqbOwfKQ+ntmUTiLSU7rpbq3sCEdyyX6Oxp2gX
X-Received: by 10.28.128.198 with SMTP id b189mr9487203wmd.105.1481756732002; 
 Wed, 14 Dec 2016 15:05:32 -0800 (PST)
Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id v2sm69378887wja.41.2016.12.14.15.05.30
 for <ci@dpdk.org>
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Wed, 14 Dec 2016 15:05:31 -0800 (PST)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: ci@dpdk.org
Date: Thu, 15 Dec 2016 00:05:17 +0100
Message-Id: <1481756723-4868-4-git-send-email-thomas.monjalon@6wind.com>
X-Mailer: git-send-email 2.7.0
In-Reply-To: <1481756723-4868-1-git-send-email-thomas.monjalon@6wind.com>
References: <1480944373-10233-1-git-send-email-thomas.monjalon@6wind.com>
 <1481756723-4868-1-git-send-email-thomas.monjalon@6wind.com>
Subject: [dpdk-ci] [PATCH v5 3/9] config: add loader and template
X-BeenThere: ci@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK CI discussions <ci.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/ci>,
 <mailto:ci-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/ci/>
List-Post: <mailto:ci@dpdk.org>
List-Help: <mailto:ci-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/ci>,
 <mailto:ci-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 14 Dec 2016 23:05:32 -0000

The configuration file will allow to set some environment-specific
options and paths to be used by the scripts.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 README                  | 11 +++++++++++
 config/ci.config        |  4 ++++
 tools/load-ci-config.sh | 14 ++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 config/ci.config
 create mode 100644 tools/load-ci-config.sh

diff --git a/README b/README
index 806ce8f..12a208c 100644
--- a/README
+++ b/README
@@ -52,3 +52,14 @@ Scripts help
 Some scripts in this repository (dpdk-ci) may help to build a test.
 
 Their purpose and options are described when using the option -h.
+
+
+Scripts configuration
+---------------------
+
+Some scripts may need some configuration.
+
+The file config/ci.config will be read if it is copied to /etc/dpdk/ci.config,
+~/.config/dpdk/ci.config or .ciconfig in this directory.
+The optional options can be uncommented to change the default values used in
+the scripts.
diff --git a/config/ci.config b/config/ci.config
new file mode 100644
index 0000000..2aeff04
--- /dev/null
+++ b/config/ci.config
@@ -0,0 +1,4 @@
+# Configuration template to be copied in
+#         /etc/dpdk/ci.config
+#     or  ~/.config/dpdk/ci.config
+#     or  .ciconfig
diff --git a/tools/load-ci-config.sh b/tools/load-ci-config.sh
new file mode 100644
index 0000000..9ec18b4
--- /dev/null
+++ b/tools/load-ci-config.sh
@@ -0,0 +1,14 @@
+#! /bin/echo must be loaded with .
+
+# Load DPDK CI config and allow override
+# from system file
+test ! -r /etc/dpdk/ci.config ||
+        . /etc/dpdk/ci.config
+# from user file
+test ! -r ~/.config/dpdk/ci.config ||
+        . ~/.config/dpdk/ci.config
+# from local file
+test ! -r $(dirname $(readlink -m $0))/../.ciconfig ||
+        . $(dirname $(readlink -m $0))/../.ciconfig
+
+# The config files must export variables in the shell style
-- 
2.7.0