-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-kojidconf-new
executable file
·113 lines (86 loc) · 3.23 KB
/
setup-kojidconf-new
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/sh
echo "======================="
echo "=== setup-kojidconf ==="
echo "======================="
# Pull in default vars
. `pwd`/defaults
# Check that all the externally defined variables we use in this script are initailized
# note: SCN is allowed to be blank so there's no need to pass it into the check
echo -n "Checking the defaults of the following: "
for i in TOP KOJIDCONF HOSTNAME PKI DISTRIBUTION NOTIFYAS REMOTEKOJI; do
if [ \$$i ]; then
echo -n "$i "
eval n=\$$i
if [ ! "$n" ]; then
echo
echo "conf error: $i is NOT defined/set in the defaults file. exiting."
exit 1
fi
fi
done
echo " (OK)"
# Note the escape chars.. without these, perl and bash do nasty things
TOPDIR=$TOP/koji
if [ ! -n "$VENDOR" ] ; then
VENDOR="Koji"
fi
cat > $KOJIDCONF << EOF
[kojid]
; The number of seconds to sleep between tasks
; sleeptime=15
; The maximum number of jobs that kojid will handle at a time
; maxjobs=10
; The minimum amount of free space (in MBs) required for each build root
; minspace=8192
; The directory root where work data can be found from the koji hub
topdir=$TOPDIR
; The directory root for temporary storage
; workdir=/tmp/koji
; The directory root for mock
; mockdir=/var/lib/mock
; The user to run as when doing builds
; mockuser=kojibuilder
; The vendor to use in rpm headers
vendor=$VENDOR
; The packager to use in rpm headers
packager=Scientific Linux
; The distribution to use in rpm headers
distribution=$DISTRIBUTION
; The _host string to use in mock
mockhost=redhat-linux-gnu
; The URL for the xmlrpc server
server=http://$HOSTNAME/kojihub
; The URL for the packages tree
pkgurl=http://$HOSTNAME/packages
; A space-separated list of hostname:repository[:use_common] tuples
; that kojid is authorized to checkout from (no quotes).
; Wildcards (as supported by fnmatch) are allowed.
; If use_common is specified and is one of "false", "no", "off", or "0"
; (without quotes), then kojid will not attempt to checkout
; a common/ dir when checking out sources from the source control system.
; Otherwise, it will attempt to checkout a common/
; dir, and will raise an exception if it cannot.
allowed_scms=$SCM
; The mail host to use for sending email notifications
smtphost=$SMTPHOST
; The From address used when sending email notifications
from_addr=Koji Build System <buildsys@$HOSTNAME>
;configuration for SSL athentication
; client certificate
; (Basically the 'username' of the buildhost
; where username = hostname)
cert = /etc/pki/koji/$HOSTNAME.pem
; certificate of the CA that issued the client certificate
ca = /etc/pki/koji/koji_ca_cert.crt
; certificate of the CA that issued the HTTP server certificate
serverca = /etc/pki/koji/koji_ca_cert.crt
EOF
# DO NOT RESTART httpd/koji just yet
# some config needs doing in setup-hub-loose-ends
#CJS added
#We need a template kojid.conf file for the remote builders because there are
#some not obvious changes that need to be made
#We are going to make a copy of the one created above and sed it with
#the changes that we need
cp $KOJIDCONF /tmp/$$
sed "s|topdir=$TOPDIR|topurl=http://$HOSTNAME/$REMOTEKOJI|" /tmp/$$ > $KOJIDCONF.remote.template