Skip to content

Commit 7a5ab4c

Browse files
committed
compile-option: Remove auto detect role code
This auto detect role code is weird. It tries to detect whether to build a hub or agent package based on the platform it's being built for. In many places it even decides to build hub packages for platforms where it's not supported. I wonder if life will just go on if I remove it. Signed-off-by: Lars Erik Wik <[email protected]>
1 parent f92051f commit 7a5ab4c

File tree

1 file changed

+2
-72
lines changed

1 file changed

+2
-72
lines changed

build-scripts/compile-options

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,6 @@ case "$OS_FAMILY" in
191191
;;
192192
esac
193193

194-
# ROLE
195-
# We can autodetect if we are building a hub or an agent, but
196-
# that is suboptimal since the list might change at any time or
197-
# we might want to build an agent package for a platform that is a hub
198-
# or viceversa. By default we assume the old behavior but if the
199-
# environment variable EXPLICIT_ROLE is defined, then we change our behavior
200-
# and build according to the role specified by it.
201-
202194
case "$EXPLICIT_ROLE" in
203195
agent)
204196
ROLE=agent
@@ -207,70 +199,8 @@ case "$EXPLICIT_ROLE" in
207199
ROLE=hub
208200
;;
209201
*)
210-
# Not running under Jenkins?
211-
if [ -z "$JENKINS_SERVER_COOKIE" ]
212-
then
213-
case "$PROJECT-$ARCH-$OS-${OS_VERSION}" in
214-
community-*)
215-
ROLE=agent
216-
;;
217-
# We do not support 32 bits hubs anymore
218-
nova-i386-*-*)
219-
ROLE=agent
220-
;;
221-
nova-s390*-*-*)
222-
ROLE=agent
223-
;;
224-
nova-*-centos-*)
225-
ROLE=hub
226-
;;
227-
nova-*-debian-*)
228-
ROLE=hub
229-
;;
230-
nova-*-opensuse-*)
231-
ROLE=hub
232-
;;
233-
nova-*-rhel-*)
234-
ROLE=hub
235-
;;
236-
nova-*-sles-*)
237-
ROLE=hub
238-
;;
239-
nova-*-ubuntu-*)
240-
ROLE=hub
241-
;;
242-
nova-*-mingw-*)
243-
ROLE=agent
244-
;;
245-
nova-*)
246-
ROLE=agent
247-
;;
248-
*)
249-
echo "Unknown project: $PROJECT"
250-
exit 42
251-
;;
252-
esac
253-
echo "Autodetected $ROLE role based on missing Jenkins label and OS."
254-
255-
else # we are running under Jenkins
256-
257-
# The "label" variable is set in multi-matrix jobs;
258-
# thus it is *not set* in the bootstrap job.
259-
case x"$label" in
260-
x)
261-
echo "label is not set, assuming that this is not the main build job; Setting ROLE=agent."
262-
ROLE=agent
263-
;;
264-
*_HUB_*)
265-
echo "Autodetected hub role based on '_HUB_' in Jenkins label."
266-
ROLE=hub
267-
;;
268-
*)
269-
echo "Autodetected agent role based on missing '_HUB_' in Jenkins label."
270-
ROLE=agent
271-
;;
272-
esac
273-
fi
202+
echo "$(basename "$0"): Error: Bad EXPLICIT_ROLE '$EXPLICIT_ROLE': defaulting to 'agent'"
203+
ROLE=agent
274204
;;
275205
esac
276206

0 commit comments

Comments
 (0)