commit
d83864234e
13
.drone.yml
Normal file
13
.drone.yml
Normal 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
9
Dockerfile
Normal 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
25
entrypoint.sh
Executable 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
|
||||
)
|
Reference in a new issue