Compare commits

..

2 commits

Author SHA1 Message Date
Bruno BELANYI 2e98292b98 ci: add Drone CI
All checks were successful
continuous-integration/drone/push Build is passing
This is my first experiment to make sure I can actually use this in my
CI.
2021-06-12 18:40:12 +02:00
Bruno BELANYI ca3b5a053c matrix-notifier: add default Drone message 2021-06-12 18:22:20 +02:00
2 changed files with 12 additions and 4 deletions

View file

@ -6,7 +6,7 @@ name: Matrix Notifier check
steps: steps:
- name: Pre-commit checks - name: Pre-commit checks
commands: commands:
- nix flake check -vvv - nix flake check
- name: Notifiy - name: Notifiy
commands: commands:
@ -20,9 +20,6 @@ steps:
from_secret: matrix_username from_secret: matrix_username
PASS: PASS:
from_secret: matrix_password from_secret: matrix_password
MESSAGE:
# FIXME: need to find a way to link
"Build ${DRONE_BUILD_STATUS} [${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}](${dummy_link}) (${DRONE_BRANCH}) by ${DRONE_COMMIT_AUTHOR}"
settings: settings:
trigger: trigger:
status: status:

View file

@ -23,6 +23,17 @@ rawurlencode() {
echo "$encoded") 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 if [ -z "$USER" ] || [ -z "$PASS" ]; then
print_err "You must provide USER and PASS" print_err "You must provide USER and PASS"
exit 1 exit 1