aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2021-03-26 12:55:45 +0000
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-03-26 13:29:37 +0000
commitd3317ef77944d230c907929bf9e6d18aff173f8a (patch)
treed133ec3ff786762b601f2aed7f1a330652c9599e /utils
parent485ec385e7292e5953ffa1a88f9193bd7175da40 (diff)
SPEC-3414: Use the right env variable namekoi_11.0.1koi/11.0.111.0.1
According to which api we sent the metadata, a different token will be used. Change-Id: I174a3b1ea30452f78390e5205d1c4d15f1bc999b Bug-AGL: SPEC-3414 Signed-off-by: Corentin LABBE <clabbe@baylibre.com> (cherry picked from commit 333a87ae923356dc2e43aa511635c2c7f5ecd16d)
Diffstat (limited to 'utils')
-rwxr-xr-xutils/agl-publish.py29
1 files changed, 18 insertions, 11 deletions
diff --git a/utils/agl-publish.py b/utils/agl-publish.py
index b559566..e2e50fc 100755
--- a/utils/agl-publish.py
+++ b/utils/agl-publish.py
@@ -7,17 +7,6 @@ import os
import json
import urllib
-if not "KCI_PUSH_TOKEN" in os.environ:
- print("Missing env variable KCI_PUSH_TOKEN")
- ptoken=None
-else:
- ptoken=os.environ["KCI_PUSH_TOKEN"]
-if not "KCI_UPLOAD_TOKEN" in os.environ:
- print("Missing env variable KCI_UPLOAD_TOKEN")
- utoken=None
-else:
- utoken=os.environ["KCI_UPLOAD_TOKEN"]
-
parser = argparse.ArgumentParser(description="AGL create bmeta", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('--arch', action='store', help="arch of the build", required=True)
parser.add_argument('--branch', action='store', help="branch of the build", required=True)
@@ -27,6 +16,24 @@ parser.add_argument('--machine', action='store', help="machine of the build", re
parser.add_argument('--api', action='store', help="URL to kernelci backend API", required=True)
args = parser.parse_args()
+KCI_PUSH_TOKEN = "AGL_KCIAPI_TOKEN"
+KCI_UPLOAD_TOKEN = "AGL_KCIAPI_TOKEN"
+
+if args.api == 'http://kernelci.dev.baylibre.com:8081/':
+ KCI_PUSH_TOKEN = "BAY_KCIAPI_TOKEN"
+ KCI_UPLOAD_TOKEN = "BAY_KCIAPI_TOKEN"
+
+if not KCI_PUSH_TOKEN in os.environ:
+ print("Missing env variable %s" % KCI_PUSH_TOKEN)
+ ptoken=None
+else:
+ ptoken=os.environ[KCI_PUSH_TOKEN]
+if not KCI_UPLOAD_TOKEN in os.environ:
+ print("Missing env variable %s" % KCI_UPLOAD_TOKEN)
+ utoken=None
+else:
+ utoken=os.environ[KCI_UPLOAD_TOKEN]
+
bmeta = {}
bmeta["arch"] = args.arch
bmeta["build_log"] = "build.log"