trigger_docker_build.sh 547 B

12345678910111213141516171819
  1. #!/bin/sh
  2. token="${1}"
  3. version="${2}"
  4. resp="$(curl -X POST \
  5. -H 'Accept: application/vnd.github.v3+json' \
  6. -H "Authorization: Bearer ${token}" \
  7. "https://api.github.com/repos/netdata/netdata/actions/workflows/docker.yml/dispatches" \
  8. -d "{\"ref\": \"master\", \"inputs\": {\"version\": \"${version}\"}}")"
  9. if [ -z "${resp}" ]; then
  10. echo "Successfully triggered Docker image build."
  11. exit 0
  12. else
  13. echo "Failed to trigger Docker image build. Output:"
  14. echo "${resp}"
  15. exit 1
  16. fi