From ca3b5a053c8f38a9f8c8d8b26fe319d7adfda37c Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 12 Jun 2021 18:22:04 +0200 Subject: [PATCH 1/2] matrix-notifier: add default Drone message --- matrix-notifier | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/matrix-notifier b/matrix-notifier index 9bf6b4c..ebc2f67 100755 --- a/matrix-notifier +++ b/matrix-notifier @@ -23,6 +23,17 @@ rawurlencode() { echo "$encoded") } +default_drone_message() { + local msg="Build ${DRONE_BUILD_STATUS}" + msg="$msg ${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BUILD_NUMBER}" + msg="$msg (${DRONE_BRANCH})" + printf '%s' "$msg" +} + +if [ "$DRONE" == "true" ] && [ -z "$MESSAGE" ]; then + MESSAGE="$(default_drone_message)" +fi + if [ -z "$USER" ] || [ -z "$PASS" ]; then print_err "You must provide USER and PASS" exit 1 From 2e98292b989e5ae4d2941ab4b1e172cfb9c89d5d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 12 Jun 2021 14:34:44 +0200 Subject: [PATCH 2/2] ci: add Drone CI This is my first experiment to make sure I can actually use this in my CI. --- .drone.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..2725c70 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,28 @@ +--- +kind: pipeline +type: exec +name: Matrix Notifier check + +steps: +- name: Pre-commit checks + commands: + - nix flake check + +- name: Notifiy + commands: + - nix run . + environment: + ADDRESS: + from_secret: matrix_homeserver + ROOM: + from_secret: matrix_roomid + USER: + from_secret: matrix_username + PASS: + from_secret: matrix_password + settings: + trigger: + status: + - failure + - success +...