root / tmp / org.txm.setups / PublishTXMUpdateSite.sh @ 1803
History | View | Annotate | Download (1.4 kB)
1 |
#!/bin/bash |
---|---|
2 |
|
3 |
echo "Sending RCP export to update site..." |
4 |
|
5 |
UPDATESITE="$HOME/workspace079/org.txm.setups/exportRCP/repository" |
6 |
# UPDATE THIS MOUNT PATH TO YOURS |
7 |
SERVERPATH="/run/user/1001/gvfs/sftp:host=vm-web-preprod.pun.ens-lyon.fr,user=mdecorde" |
8 |
DISTANTPATH="$SERVERPATH/textometrie/dist/main/" |
9 |
|
10 |
if [ "$1" = "" ] ; then |
11 |
echo "You need to specify the update site level to update" |
12 |
exit 1 |
13 |
elif [[ $1 =~ alpha|beta|dev ]] ; then |
14 |
echo "Uploading to the '$1' dist/main repository" |
15 |
DISTANTPATH="$SERVERPATH/textometrie/dist/main/" |
16 |
else |
17 |
echo "Uploading to the '$1' project update site repository" |
18 |
DISTANTPATH="$SERVERPATH/textometrie/dist/" |
19 |
fi |
20 |
|
21 |
if [ ! -d "$UPDATESITE" ]; then |
22 |
echo "** $UPDATESITE is missing." |
23 |
exit 1; |
24 |
fi |
25 |
|
26 |
# DO IT ! |
27 |
echo "ls" > pushFilesToPreprod.ftp |
28 |
echo "exit" > pushFilesToPreprod.ftp |
29 |
|
30 |
echo "Remove old files" |
31 |
rm -rf "$DISTANTPATH$1/"* |
32 |
if [ $? != 0 ]; then |
33 |
echo "Could not delete files of $DISTANTPATH$1"; |
34 |
exit 1 ; |
35 |
fi |
36 |
|
37 |
echo "Copy new files" |
38 |
mkdir "$DISTANTPATH" |
39 |
mkdir "$DISTANTPATH$1" |
40 |
cp -rf "$UPDATESITE/"* "$DISTANTPATH$1" |
41 |
if [ $? != 0 ]; then |
42 |
echo "Could not copy files of $UPDATESITE to $DISTANTPATH$1"; |
43 |
exit 1 ; |
44 |
fi |
45 |
|
46 |
echo "Rename commandes-succes.txt file" |
47 |
mv "$SERVERPATH/commandes-succes.txt" "$SERVERPATH/commandes.txt" |
48 |
if [ $? != 0 ]; then |
49 |
echo "Could not rename commandes-succes.txt file"; |
50 |
exit 1 ; |
51 |
fi |
52 |
|
53 |
echo "$1 update site updated" |