Compare commits
2 commits
0583ed2310
...
2e98292b98
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 2e98292b98 | ||
Bruno BELANYI | ca3b5a053c |
28
.drone.yml
Normal file
28
.drone.yml
Normal file
|
@ -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
|
||||
...
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue