Guest User

Untitled

a guest
Nov 19th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. # PROJECT SPECIFIC
  2. export DEPLOY_SERVER="SERVER_IP"
  3. export DEPLOY_USER="SSH_USER"
  4. export DEPLOY_PASS="SSH_PASS"
  5. export DEPLOY_DIR="DEPOY_PATH"
  6. export DEPLOY_PORT="22"
  7. export DEPLOY_VPN_USR="VPN_USR"
  8. export DEPLOY_VPN_PASS="VPN_PASS"
  9. export DEPLOY_VPN_URL="VPN_URL"
  10. # GENERAL
  11. export RSYNC="rsync -rtqx --links --safe-links --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r --delete"
  12. echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  13. # INSTALL ADDITIONAL TOOLS
  14. sudo apt install -y openconnect sshpass
  15. # CONNECT TO VPN
  16. printf "$DEPLOY_VPN_USR\n$DEPLOY_VPN_PASS\n" | sudo openconnect -b $DEPLOY_VPN_URL
  17. # DEPLOY
  18. sshpass -p $DEPLOY_PASS $RSYNC -e "ssh -p $DEPLOY_PORT" --filter="merge .deploy-filter" . $DEPLOY_USER@$DEPLOY_SERVER:$DEPLOY_DIR
Add Comment
Please, Sign In to add comment