Skip to content

Commit b4a20a3

Browse files
committed
Add node.sh for setting up and running an ubuntu ci node
1 parent 4fd5f4b commit b4a20a3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

conf/ubuntu-node/node.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
install() {
4+
sudo apt-get install build-essential
5+
sudo apt-get install openjdk-6-jdk
6+
sudo apt-get install ant
7+
sudo ln -s $PWD /builds
8+
}
9+
10+
start() {
11+
rm -f slave.jar
12+
curl -O http://ci.jruby.org/jnlpJars/slave.jar
13+
echo "Starting node"
14+
/sbin/start-stop-daemon --start --verbose --background --make-pidfile \
15+
--pidfile node.pid --exec /usr/bin/java --chdir $PWD \
16+
-- -jar slave.jar -jnlpUrl http://ci.jruby.org/computer/ubuntu-x86/slave-agent.jnlp
17+
}
18+
19+
stop() {
20+
echo "Stopping node"
21+
/sbin/start-stop-daemon --stop --quiet --pidfile node.pid
22+
}
23+
24+
case $1 in
25+
start)
26+
start
27+
;;
28+
stop)
29+
stop
30+
;;
31+
install)
32+
install
33+
;;
34+
*)
35+
echo "unknown command $1. commands are start|stop|install"
36+
exit 1
37+
;;
38+
esac

0 commit comments

Comments
 (0)