mostly filebased Content Presentation System
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

deploy.sample 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. USER=root
  3. SERVER=brain.norganoid.com
  4. LIVE_DIR=../var/www/norganoid.at/
  5. DEV_DIR=../var/www/dev.norganoid.at/
  6. CONTENT=content/
  7. ERROR="Error. Please make sure you've indicated correct parameters"
  8. if [ $# -eq 0 ]
  9. then
  10. echo $ERROR;
  11. exit 1
  12. elif [ $1 == "dev" ]
  13. then
  14. DIR=$DEV_DIR
  15. elif [ $1 == "live" ]
  16. then
  17. DIR=$LIVE_DIR
  18. else
  19. echo $ERROR
  20. exit 1
  21. fi
  22. if [[ -z $2 ]]
  23. then
  24. echo "Running App Sync (dry-run)"
  25. rsync --dry-run -az --force --delete --progress --exclude-from=.rsyncignore ./ $USER@$SERVER:$DIR;
  26. elif [[ $2 == "go" ]]
  27. then
  28. echo "Running App Sync"
  29. rsync -az --force --delete --progress --exclude-from=.rsyncignore ./ $USER@$SERVER:$DIR;
  30. elif [[ $2 == "content" ]]
  31. then
  32. if [[ -z $3 ]]
  33. then
  34. echo "Fetching Content (dry-run)"
  35. rsync --dry-run -azv --force --delete --progress --exclude-from=.rsyncignore $USER@$SERVER:$DIR$CONTENT ./$CONTENT;
  36. echo "done"
  37. elif [[ $3 == "go" ]]
  38. then
  39. echo "Fetching Content"
  40. rsync -azv --force --delete --progress --exclude-from=.rsyncignore $USER@$SERVER:$DIR$CONTENT ./$CONTENT;
  41. echo "done"
  42. elif [[ $3 == "up" ]]
  43. then
  44. if [[ -z $4 ]]
  45. then
  46. echo "Uploading Content (dry-run)"
  47. rsync --dry-run -azv --progress --exclude-from=.rsyncignore ./$CONTENT $USER@$SERVER:$DIR$CONTENT;
  48. echo "done"
  49. elif [[ $4 == "go" ]]
  50. then
  51. echo "Uploading Content"
  52. rsync -azv --progress --exclude-from=.rsyncignore ./$CONTENT $USER@$SERVER:$DIR$CONTENT;
  53. echo "done"
  54. fi
  55. fi
  56. fi