deploy-to-ovh.sh 882 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # Deploy to www.jovian-hersemeule.eu
  3. echo 'Deploy website to OVH'
  4. gitRoot=`git rev-parse --show-toplevel`
  5. origin="$gitRoot/web"
  6. host='ftp.cluster021.hosting.ovh.net'
  7. user='jovianhedk'
  8. port='21'
  9. dest='www'
  10. bash "$gitRoot/undeployed/scripts/deploy/up-date.sh"
  11. bash "$gitRoot/undeployed/scripts/deploy/up-version.sh"
  12. cd $origin
  13. files=`echo *.php include/*.php projets/*.php include/css/*.css include/css/custom/*.css include/js/*.js include/images/*.png include/images/*.jpg include/generated/*.txt`
  14. echo 'Files to be sent :'
  15. echo "$files"
  16. echo "FTP to $host"
  17. read -s -p "[deploy] password for $user: " password
  18. echo
  19. # ftp operation
  20. ftp -vin $host $port<<EOT
  21. user $user $password
  22. nmap \$1 $dest/\$1
  23. mput $files
  24. bye
  25. EOT
  26. # Cancel dump mofifications
  27. git checkout -- "$gitRoot/web/include/generated/date.txt"
  28. git checkout -- "$gitRoot/web/include/generated/version.txt"