-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-fedora-prs.sh
executable file
·84 lines (71 loc) · 2.39 KB
/
test-fedora-prs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
#-
# Copyright (c) 2021 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Author: Mikolaj Izdebski
set -eu
plan=/home/kojan/git/mbici-config/plan/bootstrap-maven-rawhide.xml
platform=/home/kojan/git/mbici-config/platform/rawhide-jdk.xml
resultDir=/mnt/nfs/mbi-result/pr
cacheDir=/mnt/nfs/mbi-cache
workDir=/tmp
rm -rf test/
mkdir test
uid=$(uuidgen)
echo === UID: $uid === >&2
echo $uid >test/uid.txt
echo === Generating Test Subject from PRs... >&2
./subject-from-fedora-prs.py -plan "$plan" $@ >test/subject.xml
echo === Generating Workflow... >&2
mbici-wf generate --plan "$plan" \
--platform "$platform" \
--subject test/subject.xml \
--workflow test/workflow.xml \
# --validate
echo === Generating initial report... >&2
mbici-wf report \
--plan "$plan" \
--platform "$platform" \
--subject test/subject.xml \
--workflow test/workflow.xml \
--result-dir "$resultDir" \
--report-dir test/report
echo === Uploading initial report to AWS... >&2
s3cmd put -r --acl-public test/report/* s3://mbi-artifacts/$uid/
echo === Flagging PRs... >&2
./flag-fedora-prs.py -uid $uid -workflow test/workflow.xml $@
echo === Running Workflow... >&2
mbici-wf kube-exec \
--namespace mbici-pr \
--max-checkout-tasks 10 \
--max-srpm-tasks 500 \
--max-rpm-tasks 200 \
--workflow test/workflow.xml \
--result-dir "$resultDir" \
--cache-dir "$cacheDir" \
--work-dir "$workDir"
echo === Generating final report... >&2
rm -rf test/report/
mbici-wf report \
--plan "$plan" \
--platform "$platform" \
--subject test/subject.xml \
--workflow test/workflow.xml \
--result-dir "$resultDir" \
--report-dir test/report
echo === Uploading final report to AWS... >&2
s3cmd put -r --acl-public test/report/* s3://mbi-artifacts/$uid/
echo === Flagging PRs... >&2
./flag-fedora-prs.py -uid $uid -workflow test/workflow.xml $@