Fix mistakes
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-10-10 22:16:30 +02:00
parent 7b9c6e775a
commit 3d69ae4744
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
4 changed files with 14 additions and 8 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "example"]
path = example
url = ../drone-deploy-example

View file

@ -5,6 +5,7 @@ RUN deno install --allow-read --allow-write --allow-env --allow-net --allow-run
COPY run.sh /bin/
RUN chmod +x /bin/run.sh
RUN touch /url && touch /temp && chmod 0777 /temp && chmod 0777 /url
USER deno
CMD ["/bin/run.sh"]

1
example Submodule

@ -0,0 +1 @@
Subproject commit 721d73edde6886e5c23a203858bf11d01422fc1b

17
run.sh
View file

@ -2,8 +2,8 @@
set -e
# Also broken
# if [ -z "$PLUGIN_DENO_DEPLOY_TOKEN" ] && [ -z "$DENO_DEPLOY_TOKEN" ]; then
if [ -z "$DENO_DEPLOY_TOKEN" ]; then
if [ -z "$PLUGIN_DENO_DEPLOY_TOKEN" ] && [ -z "$DENO_DEPLOY_TOKEN" ]; then
# if [ -z "$DENO_DEPLOY_TOKEN" ]; then
printf "A Deno Deploy token is required.\n\nGo to https://dash.deno.com/account#access-tokens to get one and set DENO_DEPLOY_TOKEN.\n"
exit 1
fi
@ -18,12 +18,12 @@ if [ -z "$PLUGIN_PROJECT" ]; then
exit 1
fi
FLAGS="--project=$PLUGIN_PROJECT"
FLAGS="$FLAGS -p=$PLUGIN_PROJECT"
# This is broken
# if [ -n "$PLUGIN_DENO_DEPLOY_TOKEN" ]; then
# FLAGS="$FLAGS --token=$PLUGIN_DENO_DEPLOY_TOKEN"
# fi
if [ -n "$PLUGIN_DENO_DEPLOY_TOKEN" ]; then
FLAGS="$FLAGS --token=$PLUGIN_DENO_DEPLOY_TOKEN"
fi
if [ -n "$PLUGIN_EXCLUDE" ]; then
FLAGS="$FLAGS --exclude=$PLUGIN_EXCLUDE"
@ -45,6 +45,7 @@ if [ -n "$PLUGIN_PROD" ] || [ -n "$PLUGIN_PRODUCTION" ]; then
FLAGS="$FLAGS --prod"
fi
# This disgusting monstrosity returns where the build was deployed to. Useful for testing and PRs.
deployctl deploy "$FLAGS" "$PLUGIN_ENTRYPOINT" | tee "$(tty)" | awk '{print $2}' | tail -2 | head -1 > url
# This disgusting monstrosity returns where the build was deployed to. Useful for testing and PRs.
deployctl deploy ${FLAGS} "$PLUGIN_ENTRYPOINT"