Browse Source

Script checking drone git changes.

Herby Vojčík 4 years ago
parent
commit
0fb6054ef0
2 changed files with 16 additions and 0 deletions
  1. 8 0
      Dockerfile
  2. 8 0
      check-vcs-changes.sh

+ 8 - 0
Dockerfile

@@ -0,0 +1,8 @@
+FROM node:lts-alpine
+WORKDIR /work
+ADD package.json .
+RUN npm install --production
+ADD check-some-are-unignored.sh .
+ADD check-vcs-changes.sh .
+RUN chmod +x ./check-*.sh
+ENTRYPOINT /work/check-vcs-changes.sh

+ 8 - 0
check-vcs-changes.sh

@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e -x
+
+if [ -n "$PLUGIN_IGNORE" -a \( -n "$PLUGIN_POSITIVE" -o -n "$PLUGIN_NEGATIVE" \) ]; then
+  set "$PLUGIN_IGNORE" "$PLUGIN_POSITIVE" "$PLUGIN_NEGATIVE"
+fi
+
+git diff --name-only "$DRONE_COMMIT_AFTER" "$DRONE_COMMIT_BEFORE" | ./check-some-are-unignored.sh "$1" "$2" "$3"