From b3769f15834616316eb21053c37c92bbae57bff2 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 5 Mar 2023 22:03:59 +0100 Subject: [PATCH] just some notes so that I dont forget what I want to do --- README.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/README.md b/README.md index f4f350b..4ab5ece 100644 --- a/README.md +++ b/README.md @@ -1 +1,81 @@ # Jenkins + +## Current cd rip process: + +udev rule +```bash +#/etc/udev/rules.d/99-cd-audio-rip.rules +SUBSYSTEM=="block",KERNEL=="sr0",ACTION=="change",RUN+="/bin/systemctl start ripper" +``` + +ripper service + +```bash +#/etc/systemd/system/ripper.service +[Unit] +Description=Auto CD ripper + +[Service] +Type=oneshot +ExecStart=/root/scripts/rip.sh + +[Install] +WantedBy=multi-user.target +~ +``` + + +ripping script + +```bash +#!/bin/bash +LOCKDIR=rip.lock +LOGFILE=/var/log/cd-rip.log + +function cleanup { + + if rmdir $LOCKDIR; then + echo "Finished $(date)" >> $LOGFILE + +else + echo "Failed to remove lock dir '$LOCKDIR'" >> $LOGFILE + exit 1 + +fi + +} + +if mkdir $LOCKDIR; then + trap "cleanup" EXIT + echo "Acquired Lock, running" >> $LOGFILE + echo "Started $(date) $$" >> $LOGFILE + abcde -c /root/.abcde.conf + #trigger LMS rescan + #wget -q --spider http://localhost:9000/settings/index.html?p0=rescan + echo "Stopped $(date) $$" >> $LOGFILE + # optional notifications, uncomment if needed + # echo "Sending IFFT webhook:">>$LOGFILE + # /home/phil/dev/ifttt_send.sh "Ripper done. Please eject CD" >> $LOGFILE + # send the logfile by email, you need to configure mail first for this to work + # cat $LOGFILE | mail -s "Ripper log" your_email@example.com +else + echo "Could not create lock, already running? '$LOCKDIR'" + exit 1 + +fi +``` + + +## Concept CD-Ripping +* udev rule triggers Jenkins Pipeline + * udev rule listens on cd insert +* Pipeline starts the cd-ripping process, ensure the music is properly tagged +* after ripping is done, it is placed in the correct folder -> tbd +* create mpd playlist to be placed on volumio server (192.168.2.43) + + +## Concept Bandcamp Downloader +* periodical run of docker container that syncs bandcamp account with local folders +* ??? + +## To-Do \ No newline at end of file