diff --git a/Dockerfile b/Dockerfile index 27da3f1..474fd8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ FROM node:10.14.1-alpine COPY entrypoint.sh /entrypoint.sh +ENV WRANGLER_HOME /github/workspace ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 6d539e0..41642f8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,16 @@ set -e +if [ -n "$CLOUDFLARE_API_KEY" ]; then + echo "CLOUDFLARE_API_KEY env var needs to be set. Add this field in the 'Secrets' section of your repo's settings." + exit 1 +fi + +if [ -n "$CLOUDFLARE_EMAIL" ]; then + echo "CLOUDFLARE_EMAIL env var needs to be set. Add this field in the 'Secrets' section of your repo's settings." + exit 1 +fi + npm i npm i @cloudflare/wrangler -g wrangler whoami