This repository has been archived on 2020-08-04. You can view files and clone it, but cannot push or open issues/pull-requests.
drone-netlify/entrypoint.sh

26 lines
530 B
Bash
Executable File

#!/bin/sh
set -e
if ! [ -e ".netlify/state.json" ]; then
echo "“.netlify/state.json” is missing, create it in your repository with “netlify deploy”"
exit 1
fi
if [ -z "$PLUGIN_DIR" ]; then
echo "Please specify “dir”"
exit 1
fi
if [ -z "$PLUGIN_AUTH_TOKEN" ]; then
echo "Please specify “auth_token”"
exit 1
fi
netlify deploy -a "$PLUGIN_AUTH_TOKEN" -d "$PLUGIN_DIR" -m "$(git log -1 --pretty=%B)" $(
if [ -n "$PLUGIN_PROD" ]; then
echo "-p"
else
echo "--alias $(git log -1 --pretty=%H)"
fi
)