Fix API breakage caused by OS Plugin version scan
[releng/global-jjb.git] / shell / sigul-install.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> sigul-install.sh"
12
13 # Ensure we fail the job if any steps fail.
14 set -eu -o pipefail
15
16 # Setup sigul RPM repo
17 echo "[fedora-infra-sigul]
18 name=Fedora builder packages for sigul
19 baseurl=https://infrastructure.fedoraproject.org/repo/infra/epel\$releasever-infra/\$basearch/
20 enabled=1
21 gpgcheck=1
22 gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAGS
23 includepkgs=sigul*
24 skip_if_unavailable=True" > fedora-infra-sigul.repo
25
26 sudo cp fedora-infra-sigul.repo /etc/yum.repos.d
27 rm fedora-infra-sigul.repo
28
29 # install sigul
30 sudo yum install -y -q sigul
31
32 # configure /etc/hosts with the sigul bridge hostname
33 # This is needed as build minions can't always get DNS resolution
34 # on the bridge
35 BRIDGE_HOST=$(grep bridge-hostname "$SIGUL_CONFIG" | awk '{print $2}')
36
37 # SIGUL_BRIDGE_IP must be defined as a Jenkins env variable
38 cp /etc/hosts hosts
39 echo -e "$SIGUL_BRIDGE_IP\t$BRIDGE_HOST" >> hosts
40 sudo cp hosts /etc/hosts
41 rm hosts