#!/usr/bin/env bash function cecho { while [ "$1" ]; do case "$1" in -normal) color="\033[00m" ;; -black) color="\033[30;01m" ;; -red) color="\033[31;01m" ;; -green) color="\033[32;01m" ;; -yellow) color="\033[33;01m" ;; -blue) color="\033[34;01m" ;; -magenta) color="\033[35;01m" ;; -cyan) color="\033[36;01m" ;; -white) color="\033[37;01m" ;; -n) one_line=1; shift ; continue ;; *) echo -n "$1"; shift ; continue ;; esac shift echo -en "$color" echo -en "$1" echo -en "\033[00m" shift done if [ ! $one_line ]; then echo fi } version="5.1.2" servers1=( gazelle.agence-esante.lu gazelle.ehealth.brussels gazellecontent.sequoiaproject.org inter-amc.kereval.com ovh3.ihe-europe.net testing.consorzioarsenal.it #testivalidointipalvelu.kanta.fi #validointipalvelu.kanta.fi ) servers=( gazelle.interopsante.org ) for i in "${servers[@]}" do cecho -blue "=======================================" cecho -blue "Working on $i" cecho -blue "=======================================" cecho -green "Downloading ear from nexus" ssh gazelle@$i "cd /tmp; rm EVSClient-ear-${version}.ear ; wget -nv --no-check-certificate https://gazelle.ihe.net/nexus/service/local/repositories/releases/content/net/ihe/gazelle/EVSClient-ear/${version}/EVSClient-ear-${version}.ear" cecho -green "Deploying ear on jboss" target=`ssh gazelle@$i "locate /standalone/deployments/EVSClient.ear | head -1"` ssh gazelle@$i "cd /tmp; cp EVSClient-ear-${version}.ear ${target}; exit;" ssh gazelle@$i 'echo "* *"`date +'%Y%m%d'` "Eric Poiseau* : Upgraded EVSClient to version ${version}" >>/home/gazelle/info.md' done