Skip to content

Commit beccb5e

Browse files
committed
Create new version path in remote server
1 parent 62516e3 commit beccb5e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

platforms/upload.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
prefix="root@snsoffice.com:/var/www/pyarmor/downloads/latest"
1+
prefix="root@snsoffice.com:/var/www/pyarmor/downloads"
22

33
for path in ./ ; do
44
echo "Search path $path ..."
@@ -9,7 +9,7 @@ for path in ./ ; do
99
# platform=$(dirname $src)
1010
# platform=${platform#./}
1111
# fi
12-
dest="$prefix/$platform"
12+
dest="$prefix/latest/$platform"
1313
echo "Upload $src to $dest"
1414
scp -i ~/.ssh/aliyun_id_rsa $src $dest
1515
done
@@ -23,5 +23,11 @@ done
2323
# Update hash of dynamic library
2424
# python make-hash.py
2525

26-
echo "Upload index.json to $prefix/"
27-
scp -i ~/.ssh/aliyun_id_rsa index.json $prefix/
26+
echo "Upload index.json to $prefix/latest"
27+
scp -i ~/.ssh/aliyun_id_rsa index.json $prefix/latest/
28+
29+
ver=$1
30+
if [[ -n "$ver" ]] ; then
31+
echo "Copy latest to remote path: /var/www/pyarmor/downloads/$ver"
32+
ssh -i ~/.ssh/aliyun_id_rsa root@snsoffice.com "rm -rf /var/www/pyarmor/downloads/$ver; cd /var/www/pyarmor/downloads; cp -a latest/ $ver"
33+
fi

0 commit comments

Comments
 (0)