message 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. TYPE=$1
  3. if [ "${TYPE}" == "dev-push" ]; then
  4. BOOT_URL="https://s3.amazonaws.com/${BUCKET_DEV}/${TRAVIS_COMMIT}/index.html"
  5. elif [ "${TYPE}" == "rc-push" ]; then
  6. BOOT_URL="https://staging.boot.netboot.xyz/${TRAVIS_TAG}/index.html"
  7. elif [ "${TYPE}" == "live-push" ]; then
  8. BOOT_URL="https://staging.boot.netboot.xyz/$(cat version.txt)/index.html"
  9. fi
  10. # send status to discord
  11. if [ "${TYPE}" == "failure" ]; then
  12. curl -X POST -H "Content-Type: application/json" --data \
  13. '{
  14. "avatar_url": "https://avatars.io/twitter/travisci",
  15. "embeds": [
  16. {
  17. "color": 16711680,
  18. "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"
  19. }
  20. ],
  21. "username": "Travis CI"
  22. }' \
  23. ${DISCORD_HOOK_URL}
  24. else
  25. curl -X POST -H "Content-Type: application/json" --data \
  26. '{
  27. "avatar_url": "https://avatars.io/twitter/travisci",
  28. "embeds": [
  29. {
  30. "color": 1681177,
  31. "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"
  32. }
  33. ],
  34. "username": "Travis CI"
  35. }' \
  36. ${DISCORD_HOOK_URL}
  37. fi