Skip to content

Instantly share code, notes, and snippets.

@bamedro
Created October 9, 2017 04:50
Show Gist options
  • Save bamedro/e3fb060ff4327b21d98a3c912962a66e to your computer and use it in GitHub Desktop.
Save bamedro/e3fb060ff4327b21d98a3c912962a66e to your computer and use it in GitHub Desktop.
#!/bin/bash
# Prepare variables
HOST=$(grep host /etc/local/proactive | cut -f2)
USERNAME=$(grep username /etc/local/proactive | cut -f2)
USERNAME=${USERNAME:-admin}
PASSWORD=$(grep password /etc/local/proactive | cut -f2)
apt-get update
apt-get install -y curl
mkdir -p /opt/proactive
cd /opt/proactive
wget --no-clobber https://s3.amazonaws.com/ci-materials/Latest_jre/jre-8u131-linux-x64.tar.gz
tar zxf jre-8u131-linux-x64.tar.gz
# Getting node.jar
wget -N https://$HOST/rest/node.jar
# Create Credential file
mkdir -p /var/lib/proactive/credentials
curl -X POST -F username=$USERNAME -F password=$PASSWORD https://$HOST/rm/portal/createcredential > /var/lib/proactive/credentials/$USERNAME.key
# Set properties for the targeted platform
if [ "$HOST" == "automation-platform.activeeon.com" ]
then
PROPERTIES="-Dproactive.communication.protocol=pnp"
MYIP=`dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'`
RMURL=pnp://$MYIP@automation-platform.activeeon.com:64738/
else
PROPERTIES="-Dproactive.net.nolocal=true -Dproactive.communication.protocol=pamr -Dproactive.pamr.router.address=$HOST"
RMURL=pamr://4096/
fi
# Launch the node
ls
/opt/proactive/jre1.8.0_131/bin/java -jar /opt/proactive/node.jar $PROPERTIES -f /var/lib/proactive/credentials/$USERNAME.key -w 1 -r $RMURL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment