-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjust-submit-scratch-builds.sh
executable file
·61 lines (50 loc) · 1.98 KB
/
just-submit-scratch-builds.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
#!/bin/bash
#
# The purpose of this script is to build the SRPM
# and then send it to Koji for scratch builds so
# all the various flavors can be tested to see if
# they build correctly
#
function check_authenticated {
output=$(koji hello)
if echo "$output" | grep -q "Authenticated"; then
return 0 # True, if "Authenticated" is found
else
return 1 # False, if "Authenticated" is not found
fi
}
# Check if authenticated with Koji
if ! check_authenticated; then
echo HEY! LOG INTO KOJI! | figlet -c -f future | lolcat
exit 1
fi
echo WE ARE LOGGED INTO KOJI! | figlet -c -f future | lolcat
START_TS=`date`
export MYDIR=$PWD
# Our current version of Fedora
export FEDORA_VERSION=`rpm -E %fedora`
#<<comment
echo Gonna submit scratch builds | figlet -c -f pagga | lolcat
echo \*\*\\nHey! We\'re assuming an SRPM file exists\\n\*\* | figlet -c -f pagga | lolcat
# Now submit them
echo Submitting to Koji | figlet -c -f future | lolcat
export SRPM_FILE=`find $HOME/rpmbuild/SRPMS -name swift-lang\*`
echo rawhide | figlet -c -f mini | lolcat
koji build --nowait --scratch rawhide $SRPM_FILE
echo f$FEDORA_VERSION | figlet -c -f mini | lolcat
koji build --nowait --scratch f$FEDORA_VERSION $SRPM_FILE
# Now the previous version of Fedora
let "FEDORA_VERSION -= 1"
echo f$FEDORA_VERSION | figlet -c -f mini | lolcat
koji build --nowait --scratch f$FEDORA_VERSION $SRPM_FILE
# And the next version
let "FEDORA_VERSION += 2"
echo f$FEDORA_VERSION | figlet -c -f mini | lolcat
koji build --scratch --nowait f$FEDORA_VERSION $SRPM_FILE
# And the EPEL versions...
echo epel9 | figlet -c -f mini | lolcat
koji build --nowait --scratch epel9 $SRPM_FILE
echo Check status at https://koji.fedoraproject.org/koji/tasks?owner=tachoknight&state=active&view=tree&method=all&order=-id
echo or use: echo or use: koji list-tasks --mine --before="\"`date -d \"+24 hours\" +\"%Y-%m-%d %H:%M\"`\"" --after="\"`date -d \"today 00:00\" +\"%Y-%m-%d %H:%M\"`\""
echo Started:_____$START_TS
echo Ended:_______`date`