deploy.sh 611 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # https://mro.name/Tagger
  3. #
  4. cd "$(dirname "${0}")" || exit 1
  5. make clean
  6. make || exit 1
  7. readonly name="meta"
  8. readonly ver="0.1"
  9. readonly src="_build/default/bin/${name}.exe"
  10. git_sha="$(sed -En '/git_sha/s/^.+"([0-9a-f]+)"/\1/gp' < lib/version.ml)"
  11. dst="${name}-v${ver}+${git_sha}-$(uname -s)-$(uname -m)"
  12. readonly git_sha dst
  13. strip "${src}"
  14. file "${src}"
  15. readonly dir="/var/www/vhosts/dev.mro.name/pages/Tagger"
  16. ssh c1 mkdir -p "${dir}" \
  17. && rsync -avPz "${src}" c1:"${dir}/${dst}" \
  18. && ssh c1 ls -Al "${dir}/${dst}" \
  19. && exit 0
  20. echo rsync -avPz "$(pwd)/${src}" c1:"${dir}/${dst}"
  21. exit 1