X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fsigul-install.sh;h=c340e6f1b33247017e9ca317b19b97997cc405bc;hb=refs%2Fheads%2Fmaster;hp=5d015ffdde5aaa071f9fac13288afdc85777aa86;hpb=afd5c39796eacb948dea8a704ed891da795d8ec4;p=releng%2Fglobal-jjb.git diff --git a/shell/sigul-install.sh b/shell/sigul-install.sh old mode 100644 new mode 100755 index 5d015ffd..c340e6f1 --- a/shell/sigul-install.sh +++ b/shell/sigul-install.sh @@ -11,10 +11,19 @@ echo "---> sigul-install.sh" # Ensure we fail the job if any steps fail. -set -eu -o pipefail +set -e -o pipefail -# Setup sigul RPM repo -echo "[fedora-infra-sigul] +OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') +if ! [[ "${OS}" =~ ^(fedora|centos|redhat) ]]; then + echo "INFO: Skip step, sigul install not available on platform ${OS}" + exit 0 +fi + +if command -v sigul &>/dev/null; then + echo "Sigul already installed; skipping installation." +else + # Setup sigul RPM repo + echo "[fedora-infra-sigul] name=Fedora builder packages for sigul baseurl=https://kojipkgs.fedoraproject.org/repos-dist/epel\$releasever-infra/latest/\$basearch/ enabled=1 @@ -23,19 +32,9 @@ gpgkey=https://infrastructure.fedoraproject.org/repo/infra/RPM-GPG-KEY-INFRA-TAG includepkgs=sigul* skip_if_unavailable=True" > fedora-infra-sigul.repo -sudo cp fedora-infra-sigul.repo /etc/yum.repos.d -rm fedora-infra-sigul.repo - -# install sigul -sudo yum install -y -q sigul - -# configure /etc/hosts with the sigul bridge hostname -# This is needed as build minions can't always get DNS resolution -# on the bridge -BRIDGE_HOST=$(grep bridge-hostname "$SIGUL_CONFIG" | awk '{print $2}') + sudo cp fedora-infra-sigul.repo /etc/yum.repos.d + rm fedora-infra-sigul.repo -# SIGUL_BRIDGE_IP must be defined as a Jenkins env variable -cp /etc/hosts hosts -echo -e "$SIGUL_BRIDGE_IP\t$BRIDGE_HOST" >> hosts -sudo cp hosts /etc/hosts -rm hosts + # install sigul + sudo yum install -y -q sigul +fi;