Skip to content

Commit 39845c2

Browse files
committed
Create "deploy.sh" and "uni15-test.sh"
1 parent e4282b0 commit 39845c2

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

deploy.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set -e
2+
3+
HOST=uni15-r
4+
SUBDIR=bicast
5+
RPM=@CMAKE_PROJECT_NAME@-@[email protected]
6+
7+
cd `dirname $0`
8+
9+
# Copy distribution
10+
scp $RPM $HOST:/tmp
11+
12+
# Install distribution -- replacing any existing installation
13+
ssh -x -T root@uni15-r bash --login <<EOF
14+
su -c "rpm --nodeps -Uvh --replacefiles --replacepkgs -p /tmp/$RPM"
15+
EOF

uni15-test.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
set -e
2+
3+
HOST=uni15-r
4+
TEST_FILE=TestFile
5+
6+
# Create a test file to be distributed
7+
dd ibs=10000 count=1 </dev/urandom >/tmp/$TEST_FILE 2>/dev/null
8+
9+
# Copy the test file to the publisher's host
10+
scp /tmp/$TEST_FILE $HOST:/tmp/$TEST_FILE
11+
12+
ssh -x -T $HOST bash --login <<EOF
13+
set -e -x
14+
15+
# Go to the test directory
16+
cd bicast
17+
18+
# Clear the publisher's root directory
19+
rm -rf pubRoot
20+
21+
# Start the publisher
22+
if publish -p 128.117.140.125:38801 &>publish.log & then
23+
PID=\$!
24+
echo \$PID >publish.pid
25+
sleep 2 # Allow publish(1) to create directory structure
26+
27+
# Link to the test file
28+
if ! ln -s /tmp/$TEST_FILE pubRoot/products/$TEST_FILE; then
29+
kill \$PID
30+
wait \$PID
31+
exit 1
32+
fi
33+
fi
34+
EOF
35+
36+
sleep 1
37+
38+
ssh -x -T $HOST bash --login <<\EOF
39+
set -e -x
40+
41+
# Go to the test directory
42+
cd bicast
43+
44+
# Terminate the publisher
45+
PID=`cat publish.pid`
46+
kill $PID
47+
# Can't `wait $PID` because it's not a child of this shell
48+
EOF

0 commit comments

Comments
 (0)