Compare commits

...

6 Commits

Author SHA1 Message Date
8b73888082 Merge pull request 'dev-migrate-supercronic' (#1) from dev-migrate-supercronic into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.jbranan.com/jblu/phc/pulls/1
2023-06-22 18:26:16 -05:00
32a9b1745d updated package
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2023-06-22 18:10:45 -05:00
0b011a28fd updated cicd
Some checks failed
continuous-integration/drone/push Build is failing
2023-06-22 17:54:02 -05:00
1ac4eb822c updated instructions
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-22 03:24:19 -05:00
1ac06a288a added supercronic
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-22 03:22:16 -05:00
c4ffcee3a3 changed to supercronic
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-19 19:01:44 -05:00
4 changed files with 57 additions and 9 deletions

View File

@ -16,7 +16,21 @@ steps:
when:
branch:
- main
- name: test
- name: docker-dev
image: plugins/docker
settings:
registry: git.jbranan.com
dry_run: false
username: jblu
password:
from_secret: gittea_drone
repo: git.jbranan.com/jblu/phc
tags:
- dev
when:
branch:
- dev*
- name: test-main
image: git.jbranan.com/jblu/phc:latest
environment:
PHC_PLEX_SECRET_TOKEN:
@ -31,6 +45,8 @@ steps:
from_secret: PHC_PLEX_PROTOCOL
PHC_PLEX_PORT:
from_secret: PHC_PLEX_PORT
CRON:
from_secret: CRON
commands:
- echo $PHC_PLEX_SECRET_TOKEN
- echo $PHC_HEALTHCHECK_URL
@ -38,4 +54,37 @@ steps:
- echo $PHC_PLEX_HOST
- echo $PHC_PLEX_PROTOCOL
- echo $PHC_PLEX_PORT
- /bin/sh /opt/phc.sh
- echo $CRON
- /bin/sh /opt/phc.sh
when:
branch:
- main
- name: test-dev
image: git.jbranan.com/jblu/phc:dev
environment:
PHC_PLEX_SECRET_TOKEN:
from_secret: PHC_PLEX_SECRET_TOKEN
PHC_HEALTHCHECK_URL:
from_secret: PHC_HEALTHCHECK_URL
PHC_HEALTHCHECK_ID:
from_secret: PHC_HEALTHCHECK_ID
PHC_PLEX_HOST:
from_secret: PHC_PLEX_HOST
PHC_PLEX_PROTOCOL:
from_secret: PHC_PLEX_PROTOCOL
PHC_PLEX_PORT:
from_secret: PHC_PLEX_PORT
CRON:
from_secret: CRON
commands:
- echo $PHC_PLEX_SECRET_TOKEN
- echo $PHC_HEALTHCHECK_URL
- echo $PHC_HEALTHCHECK_ID
- echo $PHC_PLEX_HOST
- echo $PHC_PLEX_PROTOCOL
- echo $PHC_PLEX_PORT
- echo $CRON
- /bin/sh /opt/phc.sh
when:
branch:
- dev*

View File

@ -1,9 +1,7 @@
from alpine:latest
RUN apk add --no-cache curl
COPY crontab opt
FROM alpine:latest
RUN apk add --no-cache curl supercronic
COPY entrypoint.sh opt
COPY phc.sh opt
RUN crontab /opt/crontab
RUN chmod +x /opt/entrypoint.sh
RUN chmod +x /opt/phc.sh
CMD ["/opt/entrypoint.sh"]

View File

@ -1 +0,0 @@
*/30 * * * * . /etc/environment; sh /opt/phc.sh >> /logfile

View File

@ -1,5 +1,7 @@
#!/bin/sh
printenv | grep -v "no_proxy" >> /etc/environment
CRON_CONFIG_FILE="/opt/crontab"
crond -f
echo "${CRON} sh /opt/phc.sh" > $CRON_CONFIG_FILE
exec supercronic -passthrough-logs -quiet $CRON_CONFIG_FILE