From c8d48e39d151f61a087e4f4d62bed0c1eec25a16 Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Wed, 26 Jan 2022 14:34:59 +0800 Subject: [PATCH] stx tool: Add the env variable CENGN_STRATEGY Add the environment variable CENGN_STRATEGY for supporting CENGN. Set the default value to 'cengn_first', and we also can set the value to the other three value 'cengn', 'upstream' or 'upstream_first'. Story: 2008862 Task: 44361 Signed-off-by: Zhixiong Chi Change-Id: I0326da798e808dce1b6fefd49e54f54ca41e8bcd --- stx.conf.sample | 1 + stx/lib/stx/stx_control.py | 2 ++ stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample | 3 +++ 3 files changed, 6 insertions(+) diff --git a/stx.conf.sample b/stx.conf.sample index 4160f6ec..e1978d0f 100644 --- a/stx.conf.sample +++ b/stx.conf.sample @@ -24,6 +24,7 @@ mode = local [repomgr] type = aptly cengnurl = http://mirror.starlingx.cengn.ca:80/mirror +cengnstrategy = cengn_first sourceslist = deblist = dsclist = diff --git a/stx/lib/stx/stx_control.py b/stx/lib/stx/stx_control.py index c580e150..5cf4c350 100644 --- a/stx/lib/stx/stx_control.py +++ b/stx/lib/stx/stx_control.py @@ -84,6 +84,7 @@ class HandleControlTask: buildbranch = self.stxconfig.getConfig('project', 'buildbranch') manifest = self.stxconfig.getConfig('project', 'manifest') cengnurl = self.stxconfig.getConfig('repomgr', 'cengnurl') + cengnstrategy = self.stxconfig.getConfig('repomgr', 'cengnstrategy') sourceslist = self.stxconfig.getConfig('repomgr', 'sourceslist') deblist = self.stxconfig.getConfig('repomgr', 'deblist') dsclist = self.stxconfig.getConfig('repomgr', 'dsclist') @@ -158,6 +159,7 @@ stx-pkgbuilder/configmap/') line = line.replace("@MANIFEST@", manifest) line = line.replace("@HOSTUSERNAME@", hostusername) line = line.replace("@CENGNURL@", cengnurl) + line = line.replace("@CENGNSTRATEGY@", cengnstrategy) line = line.replace("@OSTREE_OSNAME@", ostree_osname) line = line.replace("@MAX_CPUS@", max_cpus) if sourceslist: diff --git a/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample b/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample index ac63742b..b7145fce 100644 --- a/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample +++ b/stx/stx-build-tools-chart/stx-builder/configmap/localrc.sample @@ -38,6 +38,9 @@ export HOSTUSERNAME=@HOSTUSERNAME@ export CENGNURL=@CENGNURL@ +# CENGN_STRATEGY value: [ cengn|cengn_first|upstream|upstream_first ] +export CENGN_STRATEGY=@CENGNSTRATEGY@ + if [[ x"@fetch@" == x"true" ]];then export SOURCESLIST=/usr/local/bin/stx/@SOURCESLIST@ export DEBLIST=/usr/local/bin/stx/@DEBLIST@