deploy.sh 394 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. set -e
  3. if [ "$#" -ne 1 ]
  4. then
  5. echo "USAGE: $0 DOMAIN"
  6. exit 1
  7. fi
  8. export GIT_VERSION=$(git describe --tags --always --dirty --first-parent)
  9. if [ ! -d node_modules ]
  10. then
  11. yarn install
  12. fi
  13. PUBLIC_URL=/pcd yarn build
  14. echo "$GIT_VERSION" > build/VERSION
  15. echo "$(date -R)" >> build/VERSION
  16. rsync -rzv build/ deploy@$1:/var/www/$1/dashboard
  17. echo "done($GIT_VERSION)."