-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·38 lines (28 loc) · 836 Bytes
/
release.sh
File metadata and controls
executable file
·38 lines (28 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
HOST="nyx.unice.fr"
BASEDIR="/nasrainbow/www/www-ssl/p2/sigma"
if [ $# -ne 1 ]; then
echo "Usage: $0 <dir>"
echo
echo "The dir should be either:"
echo " latest for a nightly build"
echo " milestones/<name> for a milestone"
echo " releases/<name> for a release"
echo
echo "Existing:"
ssh $HOST "ls -1 $BASEDIR/{milestones,releases}"
exit 1
fi
source="releng/fr.unice.i3s.sigma.site/target/repository/"
target="$BASEDIR/$1"
echo "Uploading $source to $HOST:$target:"
echo "1. creating temp dir"
tmp=$(ssh $HOST "mktemp -d")
echo "2. copy current update site into temp"
ssh $HOST "cp -r $target/* $tmp"
echo "3. rsync to temp: $HOST:$tmp"
rsync -av $source/ $HOST:$tmp
echo "4. sync changes"
ssh -t $HOST "sudo -u www-data rsync -a $tmp/ $target"
echo "5. remove the temp: $tmp"
ssh $HOST "rm -fr $tmp"