From 8b7bad1a34d28a6a1581c2d372dd0ad90555bb8a Mon Sep 17 00:00:00 2001
From: Magnus Walbeck <magnus.walbeck@walbeck.it>
Date: Wed, 10 Mar 2021 17:51:41 +0100
Subject: [PATCH] Initial Dockerfile

---
 .drone.yml    | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Dockerfile    | 18 +++++++++++
 renovate.json |  7 ++++
 3 files changed, 115 insertions(+)
 create mode 100644 .drone.yml
 create mode 100644 Dockerfile
 create mode 100644 renovate.json

diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000..717767f
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,90 @@
+---
+kind: pipeline
+type: docker
+name: lint
+
+steps:
+  - name: Lint Dockerfile
+    image: hadolint/hadolint
+    commands:
+      - hadolint Dockerfile
+    when:
+      status:
+        - failure
+        - success
+
+trigger:
+  event:
+    - pull_request
+    - push
+  ref:
+    exclude:
+      - refs/heads/renovate/*
+
+---
+kind: pipeline
+type: docker
+name: test
+
+steps:
+  - name: build test
+    image: plugins/docker
+    settings:
+      dockerfile: Dockerfile
+      repo: mwalbeck/nextcloud-notify-push
+      dry_run: true
+
+trigger:
+  event:
+    - pull_request
+
+depends_on:
+  - lint
+
+---
+kind: pipeline
+type: docker
+name: release
+
+steps:
+  - name: determine tags
+    image: mwalbeck/determine-docker-tags
+    environment:
+      VERSION_TYPE: "docker_env"
+      APP_NAME: "NOTIFY_PUSH"
+      DOCKERFILE_PATH: "Dockerfile"
+      CUSTOM_TAGS: "latest"
+
+  - name: build and publish
+    image: plugins/docker
+    settings:
+      dockerfile: Dockerfile
+      username:
+        from_secret: dockerhub_username
+      password:
+        from_secret: dockerhub_password
+      repo: mwalbeck/nextcloud-notify-push
+  
+  - name: notify
+    image: plugins/matrix
+    settings:
+      homeserver: https://matrix.mwalbeck.org
+      roomid:
+        from_secret: matrix_roomid
+      username:
+        from_secret: matrix_username
+      password:
+        from_secret: matrix_password
+    when:
+      status:
+        - success
+        - failure
+
+trigger:
+  branch:
+    - master
+  event:
+    - push
+
+depends_on:
+  - lint
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..311f07b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,18 @@
+FROM ekidd/rust-musl-builder:1.50.0 as build
+
+# renovate: datasource=github-tags depName=nextcloud/notify_push versioning=semver
+ENV NOTIFY_PUSH_VERSION v0.1.6
+
+RUN set -ex; \
+    git clone --branch $NOTIFY_PUSH_VERSION https://github.com/nextcloud/notify_push.git .; \
+    cargo build --release --target=x86_64-unknown-linux-musl;
+
+FROM scratch
+
+COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/notify_push /
+
+EXPOSE 7867
+
+USER 605
+
+CMD ["/notify_push"]
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 0000000..af8effb
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,7 @@
+{
+  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+  "extends": [
+    "github>mwalbeck/renovate-config",
+    "github>mwalbeck/renovate-config:docker"
+  ]
+}