message 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. set -e
  3. TYPE=$1
  4. if [ "${TYPE}" == "dev-push" ]; then
  5. BOOT_URL="https://s3.amazonaws.com/${BUCKET_DEV}/${TRAVIS_COMMIT}/index.html"
  6. elif [ "${TYPE}" == "rc-push" ]; then
  7. BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)-RC/index.html"
  8. elif [ "${TYPE}" == "live-push" ]; then
  9. BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)/index.html"
  10. fi
  11. # send status to discord
  12. if [ "${TYPE}" == "failure" ]; then
  13. curl -X POST -H "Content-Type: application/json" --data \
  14. '{
  15. "avatar_url": "https://avatars.io/twitter/travisci",
  16. "embeds": [
  17. {
  18. "color": 16711680,
  19. "description": "__**Failed to Build**__ \n**Build:** '${TRAVIS_BUILD_WEB_URL}'\n**Status:** Failure\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${TRAVIS_COMMIT}'\n"
  20. }
  21. ],
  22. "username": "Travis CI"
  23. }' \
  24. ${DISCORD_HOOK_URL}
  25. else
  26. curl -X POST -H "Content-Type: application/json" --data \
  27. '{
  28. "avatar_url": "https://avatars.io/twitter/travisci",
  29. "embeds": [
  30. {
  31. "color": 1681177,
  32. "description": "__**Boot Menu Published**__ \n**Files:** '${BOOT_URL}' \n**Build:** '${TRAVIS_BUILD_WEB_URL}'\n**Change:** https://github.com/netbootxyz/netboot.xyz/commit/'${TRAVIS_COMMIT}'\n"
  33. }
  34. ],
  35. "username": "Travis CI"
  36. }' \
  37. ${DISCORD_HOOK_URL}
  38. fi