mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 21:25:38 +00:00
introduced command line options for uploadRepositoryToServer.sh for proxy/tunnel upload
Change-Id: Ib35d0de686c9f4f6660726a5a4bb9fbc69457933
This commit is contained in:
@@ -9,23 +9,36 @@ set -u
|
||||
USER="trac"
|
||||
SERVER="sapsailing.com"
|
||||
REPO_HOME="/home/trac/p2-repositories"
|
||||
PORT=22
|
||||
|
||||
DATE=`date +%s`
|
||||
|
||||
options='u:h:p:'
|
||||
while getopts $options option
|
||||
do
|
||||
case $option in
|
||||
u) USER=$OPTARG;;
|
||||
p) PORT=$OPTARG;;
|
||||
h) SERVER=$OPTARG;;
|
||||
\?) echo "Invalid option"
|
||||
exit 4;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "Performing backup of old repository to $REPO_HOME/sailing.backup.$DATE..."
|
||||
ssh $USER@$SERVER "cp -r $REPO_HOME/sailing $REPO_HOME/sailing.backup.$DATE"
|
||||
ssh -p $PORT $USER@$SERVER "cp -r $REPO_HOME/sailing $REPO_HOME/sailing.backup.$DATE"
|
||||
|
||||
echo "Removing old p2-repository"
|
||||
ssh $USER@$SERVER "rm -rf $REPO_HOME/sailing"
|
||||
ssh -p $PORT $USER@$SERVER "rm -rf $REPO_HOME/sailing"
|
||||
|
||||
echo "Uploading local repository to $REPO_HOME/sailing"
|
||||
scp -r ../../com.sap.sailing.targetplatform.base/target/repository $USER@$SERVER:$REPO_HOME/sailing
|
||||
scp -P $PORT -r ../../com.sap.sailing.targetplatform.base/target/repository $USER@$SERVER:$REPO_HOME/sailing
|
||||
|
||||
echo "Making readable for everyone..."
|
||||
ssh $USER@$SERVER "chmod -R 775 . $REPO_HOME/sailing"
|
||||
ssh -p $PORT $USER@$SERVER "chmod -R 775 $REPO_HOME/sailing"
|
||||
|
||||
echo "Remote files now available:"
|
||||
ssh $USER@$SERVER "ls -lah $REPO_HOME/sailing"
|
||||
ssh -p $PORT $USER@$SERVER "ls -lah $REPO_HOME/sailing"
|
||||
|
||||
echo ""
|
||||
echo "Make SURE to notify developers that they need to update their target platform!!!"
|
||||
|
||||
Reference in New Issue
Block a user