зеркало из
1
0
Форкнуть 0
azure-quickstart-templates/jenkins-on-ubuntu/jenkSlaveInstall.sh

34 строки
1.0 KiB
Bash
Исходник Обычный вид История

2015-04-25 06:29:58 +03:00
#!/bin/bash
#########################################################
# Script Name: jenkSlaveInstall.sh
# Author: Dennis Angeline - Full Scale 180 Inc
# Version: 0.1
# Last Modified By: Dennis Angeline
# Description:
# This script install Jenkins slave on an Ubuntu VM image
# Parameters :
2015-04-25 20:18:47 +03:00
# MASTERNODE: The ip address of the master node
# SLAVENODE: The name of this slave node
2015-04-25 06:29:58 +03:00
# Note :
2015-04-25 20:18:47 +03:00
# This script has only been tested on Ubuntu 14.04 LTS and must be root
2015-04-25 06:29:58 +03:00
#######################################################
2015-04-25 07:45:36 +03:00
MASTERNODE=$1
SLAVENODE=$2
2015-04-25 06:29:58 +03:00
2015-04-25 22:35:13 +03:00
# Install Java
2015-04-25 20:18:47 +03:00
echo "Installing openjdk-7"
apt-get -y update
apt-get -y install openjdk-7-jdk
2015-04-25 22:35:13 +03:00
# Download slave.jar from master
2015-04-25 08:07:17 +03:00
echo "Downloading slave.jar from $MASTERNODE"
2015-04-25 20:41:26 +03:00
wget http://$MASTERNODE:8080/jnlpJars/slave.jar -O ~/slave.jar
2015-04-25 20:48:43 +03:00
chmod 777 ~/slave.jar
2015-04-25 08:07:17 +03:00
2015-04-25 22:35:13 +03:00
# Launch slave agent
2015-04-25 08:07:17 +03:00
echo "Executing slave.jar with http://$MASTERNODE:8080/computer/$SLAVENODE/slave-agent.jnlp"
2015-04-27 07:18:32 +03:00
nohup java -jar ~/slave.jar -jnlpUrl http://$MASTERNODE:8080/computer/$SLAVENODE/slave-agent.jnlp &
2015-04-25 06:29:58 +03:00