preparing DSR automation procedure

This commit is contained in:
Charles N Wyble 2024-12-04 14:14:39 -06:00
parent 25fe5cfd73
commit d011825524
10 changed files with 58 additions and 13 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
dsrtemp/

View File

View File

@ -1,9 +1,8 @@
#!/bin/bash
echo "Creating PDF of DSR from markdown input via pandoc..."
INPUT_FILE="./DSR-$(date +%m-%d-%Y).md"
OUTPUT_FILE="./DSR-$(date +%m-%d-%Y).pdf"
TODAY_DATE=$(date +%m-%d-%Y)
INPUT_FILE="./DSR-$TODAY_DATE.md"
OUTPUT_FILE="./DSR-$TODAY_DATE.pdf"
METADATA_FILE="daily-stakeholder-report.yml"
TEMPLATE="eisvogel"

View File

@ -1,6 +1,5 @@
#!/bin/bash
secrets_manager()
{
@ -42,9 +41,6 @@ post_dsr()
{
echo "Posting DSR..."
#!/bin/bash
# Replace these with your Discourse instance details
DISCOURSE_URL="https://community.turnsys.com" # e.g., https://forum.example.com
API_KEY="$DISCOURSE_APIKEY" # Your API key
API_USERNAME="reachableceo" # API username or admin account
@ -53,13 +49,13 @@ API_USERNAME="reachableceo" # API username or admin account
CATEGORY_ID=61
# The title for the post (generated here; customize as needed)
TITLE="Daily Stakeholder Report - $(date +'%m-%d-%Y')"
TITLE="Daily Stakeholder Report - $TODAY_DATE"
# The content of the post
CONTENT="Please see the attached PDF for today's report."
CONTENT="Please use the link below to download today's stakeholder report."
# The file to upload (from the second argument or auto-generated based on date)
FILE_PATH="./DSR-"$(date +%m-%d-%Y)".pdf"
FILE_PATH="./DSR-$TODAY_DATE.pdf"
# Check if the file exists
if [ ! -f "$FILE_PATH" ]; then
@ -91,7 +87,7 @@ fi
echo "File uploaded successfully. Short URL: $short_url"
# Append the file link to the post content (Markdown format)
CONTENT="$CONTENT\n\n[Download the PDF]($short_url)"
CONTENT="$CONTENT\n\n[Download todays report in PDF format]($short_url)"
# Create the new topic
echo "Creating new topic..."
@ -118,10 +114,15 @@ else
echo "$post_response"
exit 1
fi
}
#Get discourse api key
secrets_manager
#Create a new topic and upload/attach PDF to the topic
# - Create a new topic
# - upload PDF to discourse
# - attach uploaded PDF to the topic
post_dsr

35
endstops/end-day.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
# Wrap up my instrumented day into a (mostly) automated report and publish to discourse
# Gather DSR assets
# My manually entered notations
./dsr-input/dsr-gather-joplin-log.sh
# My gitea data
./dsr-input/dsr-gather-gitea.sh
# My redmine data
./dsr-input/dsr-gather-redmine.sh
# My wakapi data
./dsr-input/dsr-gather-waka-api.sh
# My activity watch data
./dsr-input/dsr-gather-activitywatch.sh
# My habit tracker data
./dsr-input/dsr-gather-habits.sh
# My health/fitnes data
./dsr-input/dsr-gather-fitness.sh
# My diet data
./dsr-input/dsr-gather-diet.sh
# Produce DSR PDF asset
./dsr-publish/create-dsr-pdf.sh
# Publish DSR to the world
./dsr-publish/publish-dsr.sh

9
endstops/start-day.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
# Start my instrumented day
# Create a new blank DSR for the day
./dsr-joplin-create/dsr-new.sh
# Populate my Joplin note "Todays objectives" section based on Redmine due dates
./dsr-joplin-create/dsr-populate-objectives.sh