summaryrefslogtreecommitdiffstats
path: root/.travis/trigger_artifact_build.sh
blob: 3ec5d02d026a6b3070d8207e43133cfcc6850ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

token="${1}"
version="${2}"
type="${3}"

resp="$(curl -X POST \
             -H 'Accept: application/vnd.github.v3+json' \
             -H "Authorization: Bearer ${token}" \
             "https://api.github.com/repos/netdata/netdata/actions/workflows/build.yml/dispatches" \
             -d "{\"ref\": \"master\", \"inputs\": {\"version\": \"${version}\", \"type\": \"${type}\"}}")"

if [ -z "${resp}" ]; then
    echo "Successfully triggered release artifact build."
    exit 0
else
    echo "Failed to trigger release artifact build. Output:"
    echo "${resp}"
    exit 1
fi