fix: ensure the dokku-retire timer is properly installed

Closes #3615
This commit is contained in:
Jose Diaz-Gonzalez
2019-07-17 17:44:42 -04:00
parent 22ffa41d31
commit 5a52286309
2 changed files with 24 additions and 0 deletions

View File

@@ -38,9 +38,15 @@ Description=Run dokku-retire.service every 5 minutes
[Timer]
OnCalendar=*:0/5
Persistent=true
[Install]
WantedBy=timers.target
EOF
if command -v systemctl &>/dev/null; then
systemctl --quiet reenable dokku-retire
systemctl --quiet enable dokku-retire.timer
systemctl --quiet start dokku-retire.timer
fi
else
cat <<EOF >/etc/cron.d/dokku-retire

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bats
load test_helper
setup() {
global_setup
}
teardown() {
global_teardown
}
@test "(scheduler-docker-local) timer installed" {
run /bin/bash -c "systemctl list-timers | grep dokku-retire"
echo "output: $output"
echo "status: $status"
assert_success
}