publish_version.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. set -e
  3. TORBROWSER_VERSION=$1
  4. if [ -z "${TORBROWSER_VERSION}" ]; then
  5. echo "please specify version number (excluding -buildN)"
  6. exit 1
  7. fi
  8. PREV_TORBROWSER_VERSION=$2
  9. if [ -z "${PREV_TORBROWSER_VERSION}" ]; then
  10. echo "please specify a previous version number (needed for copying .htaccess file)"
  11. exit 1
  12. fi
  13. wget --continue -nH --cut-dirs=2 -r -l 1 "https://people.torproject.org/~sysrqb/builds/${TORBROWSER_VERSION}"
  14. #wget --continue -nH --cut-dirs=2 -r -l 1 "https://people.torproject.org/~gk/builds/${TORBROWSER_VERSION}"
  15. rm "${TORBROWSER_VERSION}/index.html*"
  16. date
  17. mv "${TORBROWSER_VERSION}" /srv/dist-master.torproject.org/htdocs/torbrowser/
  18. cp "/srv/dist-master.torproject.org/htdocs/torbrowser/${PREV_TORBROWSER_VERSION}/.htaccess" "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}/"
  19. chmod 775 "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"
  20. chmod 664 "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"/*
  21. chown -R :torwww "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"
  22. cd "/srv/dist-master.torproject.org/htdocs/torbrowser/${TORBROWSER_VERSION}"
  23. for i in *.asc; do echo "$i"; gpg -q "$i" || exit; done
  24. date
  25. static-update-component dist.torproject.org
  26. mkdir "/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser/${TORBROWSER_VERSION}"
  27. chmod 775 "/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser/${TORBROWSER_VERSION}"
  28. cd "/srv/cdn-master.torproject.org/htdocs/aus1/torbrowser/${TORBROWSER_VERSION}"
  29. for marfile in /srv/dist-master.torproject.org/htdocs/torbrowser/"${TORBROWSER_VERSION}"/*.mar; do ln -f "${marfile}" .; done
  30. date
  31. static-update-component cdn.torproject.org
  32. echo "Now sync and publish update responses"