diff --git a/Makefile b/Makefile index 3a0645364eb..79fd4a84eae 100644 --- a/Makefile +++ b/Makefile @@ -318,6 +318,7 @@ gen-ts: # Use this make target to regenerate the configuration YAML files when # you modify starlark files. drone: $(DRONE) + bash scripts/drone/env-var-check.sh $(DRONE) starlark --format $(DRONE) lint .drone.yml --trusted $(DRONE) --server https://drone.grafana.net sign --save grafana/grafana diff --git a/scripts/drone/env-var-check.sh b/scripts/drone/env-var-check.sh new file mode 100755 index 00000000000..adfbe88f4ce --- /dev/null +++ b/scripts/drone/env-var-check.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# ensure DRONE_SERVER and DRONE_TOKEN env variables are set +if [ -z "$DRONE_SERVER" ]; then + echo "DRONE_SERVER environment variable is not set." + exit 1 +fi + +if [ -z "$DRONE_TOKEN" ]; then + echo "DRONE_TOKEN environment variable is not set." + exit 1 +fi \ No newline at end of file