deploy-to-ovh.sh 903 B

123456789101112131415161718192021222324252627282930313233343536
  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. cd $origin
  11. 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`
  12. echo 'Files to be sent :'
  13. echo "$files"
  14. echo "FTP to $host"
  15. read -s -p "[deploy] password for $user: " password
  16. echo
  17. # Dump varying files
  18. bash "$gitRoot/undeployed/scripts/deploy/up-date.sh"
  19. bash "$gitRoot/undeployed/scripts/deploy/up-version.sh"
  20. # ftp operation
  21. ftp -vin $host $port<<EOT
  22. user $user $password
  23. nmap \$1 $dest/\$1
  24. mput $files
  25. bye
  26. EOT
  27. # Cancel dump mofifications
  28. git checkout -- "$gitRoot/web/include/generated/date.txt"
  29. git checkout -- "$gitRoot/web/include/generated/version.txt"