Init
continuous-integration/drone/push Build is passing Details

master
Simon Bruder 2020-08-04 00:47:49 +02:00
commit d83864234e
No known key found for this signature in database
GPG Key ID: 6F03E0000CC5B62F
3 changed files with 47 additions and 0 deletions

13
.drone.yml Normal file
View File

@ -0,0 +1,13 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
registry: r.sbruder.de
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: r.sbruder.de/drone-netlify

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:alpine
RUN apk add --no-cache git
RUN yarn global add netlify-cli
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

25
entrypoint.sh Executable file
View File

@ -0,0 +1,25 @@
#!/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
)