Skip to content

Commit

Permalink
cicd: Dockerfile and entry script
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorpeJosh committed Oct 26, 2023
1 parent dfee6bc commit 75bf9df
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:3.18.4@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978

RUN apk add --update --no-cache \
ca-certificates \
curl \
jq \
supercronic \
tzdata \
&& rm -rf /var/cache/apk/* /.cache

COPY --chmod=500 entry.sh /entry.sh
COPY --chmod=500 unlock.sh /usr/local/bin/unlock

CMD ["/entry.sh"]
15 changes: 15 additions & 0 deletions entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

if [ -n "$CRONTAB" ]; then
echo "$CRONTAB" > /crontab.txt
else
echo "Error: Missing 'CRONTAB' environment variable"
exit 1
fi

# Test crontab
echo "Testing crontab.txt"
supercronic -test -debug /crontab.txt || exit 1

# Start supercronic
supercronic -passthrough-logs /crontab.txt

0 comments on commit 75bf9df

Please sign in to comment.