mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 06:08:02 +02:00
contrib/rh-bkr: fix jenkins script to schedule beaker jobs
This commit is contained in:
parent
92c9439b34
commit
e319e59d75
2 changed files with 19 additions and 3 deletions
|
|
@ -585,6 +585,9 @@ class CmdSubmit(CmdBase):
|
||||||
self.subs['RPM_LIST'] = [ u for x in self.rpm for u in x[1].urls() ]
|
self.subs['RPM_LIST'] = [ u for x in self.rpm for u in x[1].urls() ]
|
||||||
|
|
||||||
tests = []
|
tests = []
|
||||||
|
t = self._get_var("TESTS")
|
||||||
|
if t:
|
||||||
|
tests.extend([t])
|
||||||
if self.options.tests:
|
if self.options.tests:
|
||||||
tests.extend(self.options.tests)
|
tests.extend(self.options.tests)
|
||||||
if self.options.nitrate_all or self.options.nitrate_tag or self.options.nitrate_exclude_tag:
|
if self.options.nitrate_all or self.options.nitrate_tag or self.options.nitrate_exclude_tag:
|
||||||
|
|
@ -607,11 +610,11 @@ class CmdSubmit(CmdBase):
|
||||||
else:
|
else:
|
||||||
print("Selected %d cases..." % (len(cases)))
|
print("Selected %d cases..." % (len(cases)))
|
||||||
nitrate_print_cases(cases, prefix=" + ")
|
nitrate_print_cases(cases, prefix=" + ")
|
||||||
tests.extend([nitrate_get_script_name_for_case(case) for case_id, case in cases.iteritems()])
|
tests.extend(sorted(set([nitrate_get_script_name_for_case(case) for case_id, case in cases.iteritems()])))
|
||||||
elif self.options.nitrate_status or self.options.nitrate_exclude_status:
|
elif self.options.nitrate_status or self.options.nitrate_exclude_status:
|
||||||
raise Exception("--nitrate-status or --nitrate-exclude-status makes only sense with selecting nitrate tags")
|
raise Exception("--nitrate-status or --nitrate-exclude-status makes only sense with selecting nitrate tags")
|
||||||
|
|
||||||
self.subs['TESTS'] = ','.join(sorted(set(tests)))
|
self.subs['TESTS'] = ','.join(tests)
|
||||||
self.subs['ARGV'] = ("\"" + "\" \"".join(sys.argv) + "\"").replace('"', '"') if sys.argv else ''
|
self.subs['ARGV'] = ("\"" + "\" \"".join(sys.argv) + "\"").replace('"', '"') if sys.argv else ''
|
||||||
self.subs['ARGV_PROFILE'] = ("\"" + "\" \"".join(self.argv_profile) + "\"").replace('"', '"') if hasattr(self, 'argv_profile') else ''
|
self.subs['ARGV_PROFILE'] = ("\"" + "\" \"".join(self.argv_profile) + "\"").replace('"', '"') if hasattr(self, 'argv_profile') else ''
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,11 @@ DIR="$(dirname "$(readlink -f "$0")")"
|
||||||
# HOSTYPE=
|
# HOSTYPE=
|
||||||
# TESTS=
|
# TESTS=
|
||||||
# ARGS=
|
# ARGS=
|
||||||
|
# GIT_TARGETBRANCH=
|
||||||
|
|
||||||
|
# Trigger from remote:
|
||||||
|
# TOKEN_NAME= // secret
|
||||||
|
# URL="https://desktopqe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/NetworkManager-upstream/buildWithParameters?token=$TOKEN_NAME&cause=$CAUSE&ARGS=..."
|
||||||
|
|
||||||
RPM=()
|
RPM=()
|
||||||
for r in $RPM_URLS; do
|
for r in $RPM_URLS; do
|
||||||
|
|
@ -45,6 +50,12 @@ for r in $ARGS; do
|
||||||
_ARGS+=("$r")
|
_ARGS+=("$r")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -n "$GIT_TARGETBRANCH" -a "$GIT_TARGETBRANCH" != "--" ]; then
|
||||||
|
GIT_TARGETBRANCH=(--var "GIT_TARGETBRANCH=$GIT_TARGETBRANCH")
|
||||||
|
else
|
||||||
|
GIT_TARGETBRANCH=()
|
||||||
|
fi
|
||||||
|
|
||||||
export WHITEBOARD="$BUILD_URL"
|
export WHITEBOARD="$BUILD_URL"
|
||||||
|
|
||||||
python -u \
|
python -u \
|
||||||
|
|
@ -59,9 +70,11 @@ python -u \
|
||||||
"${PROFILE[@]}" \
|
"${PROFILE[@]}" \
|
||||||
"${HOSTTYPE[@]}" \
|
"${HOSTTYPE[@]}" \
|
||||||
--var "TESTS=$TESTS" \
|
--var "TESTS=$TESTS" \
|
||||||
|
"${GIT_TARGETBRANCH[@]}" \
|
||||||
|
--var "GIT_URL=$GIT_TEST_REPOSITORY" \
|
||||||
--bkr-write-job-id 'beaker_job_id' \
|
--bkr-write-job-id 'beaker_job_id' \
|
||||||
--bkr-wait-completion \
|
--bkr-wait-completion \
|
||||||
--bkr-job-results 'results.txt' \
|
--bkr-job-results 'results.xml' \
|
||||||
--no-test \
|
--no-test \
|
||||||
"${_ARGS[@]}"
|
"${_ARGS[@]}"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue