feat: Add Nomad deployment configuration and update email handling
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 19s

This commit is contained in:
2026-01-18 06:32:37 -08:00
parent bb6e4b995f
commit 5e987ce26e
5 changed files with 70 additions and 1 deletions

3
.env.example Normal file
View File

@@ -0,0 +1,3 @@
GMAIL_USER=your_email@gmail.com
GMAIL_APP_PASSWORD=your_app_password
RECIPIENT_EMAIL=recipient1@example.com,recipient2@example.com

View File

@@ -53,4 +53,4 @@ jobs:
nomad status
nomad job run \
-var="container_version=${{ steps.container_version.outputs.sha }}" \
foodplanner.nomad
finance-app.nomad

35
.gitignore vendored Normal file
View File

@@ -0,0 +1,35 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Secrets
.env
.env.local
.env.*
*.pem
*.key
id_rsa
secrets/
# IDEs
.idea/
.vscode/

26
finance-app.nomad Normal file
View File

@@ -0,0 +1,26 @@
job "finance-app" {
datacenters = ["dc1"]
type = "service"
variable "container_version" {
default = "latest"
}
group "finance-app" {
count = 1
task "finance-app" {
driver = "docker"
config {
image = "gitea.service.dc1.fbleagh.duckdns.org/sstent/DailyEmail-Finance:${var.container_version}"
}
env {
GMAIL_USER = "stuart.stent@gmail.com"
GMAIL_APP_PASSWORD = "qacyyoxcddwbxyfw"
RECIPIENT_EMAIL = "stuart.stent@gmail.com,sdoltonz@gmail.com"
}
}
}
}

View File

@@ -42,6 +42,11 @@ class FinanceEmailer:
self.gmail_app_password = os.environ.get('GMAIL_APP_PASSWORD')
self.recipient_email = os.environ.get('RECIPIENT_EMAIL')
if self.recipient_email:
# Clean up and normalize email list
recipients = [e.strip() for e in self.recipient_email.split(',') if e.strip()]
self.recipient_email = ", ".join(recipients)
if not all([self.gmail_user, self.gmail_app_password, self.recipient_email]):
raise ValueError("Missing required environment variables")