add cronjob
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
@ -17,6 +17,8 @@ steps:
|
|||||||
DOMAIN: {{ .Name }}.swarm-test.autonomic.zone
|
DOMAIN: {{ .Name }}.swarm-test.autonomic.zone
|
||||||
STACK_NAME: {{ .Name }}
|
STACK_NAME: {{ .Name }}
|
||||||
LETS_ENCRYPT_ENV: production
|
LETS_ENCRYPT_ENV: production
|
||||||
|
CRON_ENTRYPOINT_VERSION: v1
|
||||||
|
PRETIX_CONFIG_VERSION: v1
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
|
1
abra.sh
1
abra.sh
@ -1 +1,2 @@
|
|||||||
export PRETIX_CONFIG_VERSION=v1
|
export PRETIX_CONFIG_VERSION=v1
|
||||||
|
export CRON_ENTRYPOINT_VERSION=v1
|
||||||
|
16
compose.yml
16
compose.yml
@ -68,6 +68,19 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
|
||||||
|
cron:
|
||||||
|
image: alpinelinux/docker-cli:latest
|
||||||
|
environment:
|
||||||
|
- STACK_NAME=${STACK_NAME}
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
entrypoint:
|
||||||
|
/entrypoint.sh
|
||||||
|
configs:
|
||||||
|
- source: cron_entrypoint
|
||||||
|
target: /entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
app:
|
app:
|
||||||
postgres:
|
postgres:
|
||||||
@ -78,6 +91,9 @@ configs:
|
|||||||
name: ${STACK_NAME}_pretix_config_${PRETIX_CONFIG_VERSION}
|
name: ${STACK_NAME}_pretix_config_${PRETIX_CONFIG_VERSION}
|
||||||
file: pretix.cfg.tmpl
|
file: pretix.cfg.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
cron_entrypoint:
|
||||||
|
name: ${STACK_NAME}_cron_entrypoint_${CRON_ENTRYPOINT_VERSION}
|
||||||
|
file: entrypoint.cron.sh
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
|
3
entrypoint.cron.sh
Normal file
3
entrypoint.cron.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo '15,45 * * * * docker exec $(docker ps -qf 'name=${STACK_NAME}_app') pretix runperiodic' | crontab - && crond -f -d 8
|
Reference in New Issue
Block a user