59 lines
1.0 KiB
HCL
59 lines
1.0 KiB
HCL
job "qautomate" {
|
|
periodic {
|
|
cron = "*/30 * * * *"
|
|
prohibit_overlap = true
|
|
}
|
|
datacenters = ["dc1"]
|
|
|
|
type = "batch"
|
|
|
|
group "app" {
|
|
count = 1
|
|
|
|
task "setup" {
|
|
driver = "docker"
|
|
|
|
lifecycle {
|
|
hook = "prestart"
|
|
}
|
|
|
|
config {
|
|
image = "ghcr.io/sstent/ubuntu-python3"
|
|
// command = "/bin/bash"
|
|
args = ["-v","-c", "/local/prestart.sh"]
|
|
|
|
}
|
|
|
|
template {
|
|
data = <<EOH
|
|
#!/bin/bash
|
|
rm /usr/lib/python3.11/EXTERNALLY-MANAGED
|
|
pip3 install qbittorrent-api --upgrade
|
|
python3 /local/torrent_tagger.py
|
|
python3 /local/torrent_tidy.py
|
|
|
|
EOH
|
|
perms = 0777
|
|
destination = "local/prestart.sh"
|
|
}
|
|
|
|
template {
|
|
change_mode = "restart"
|
|
data = "{{ key \"functions/torrent_tagger\" }}"
|
|
destination = "local/torrent_tagger.py"
|
|
}
|
|
|
|
template {
|
|
change_mode = "restart"
|
|
data = "{{ key \"functions/torrent_tidy\" }}"
|
|
destination = "local/torrent_tidy.py"
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} |