wip: cron shell script for testing

This commit is contained in:
Suyono 2023-12-02 15:54:41 +11:00
parent 11dbe7d4f0
commit 171c799a31
7 changed files with 26 additions and 9 deletions

View File

@ -1,13 +1,21 @@
FROM rust:alpine as builder
ADD . /root/wingmate
WORKDIR /root/wingmate
RUN apk add musl-dev && cargo clean && \
cargo build --release
FROM alpine
COPY --from=builder target/debug/init /usr/local/bin/init
ADD docker/etc/ /etc/
COPY --from=builder /root/wingmate/target/release/wingmate-rs /usr/local/bin/wingmate
COPY --from=builder /root/wingmate/target/release/wmtest-helper-dummy /usr/local/bin/wmtest-helper-dummy
COPY --from=builder /root/wingmate/target/release/wmtest-helper-spawner /usr/local/bin/wmtest-helper-spawner
COPY --from=builder /root/wingmate/target/release/wmtest-helper-log /usr/local/bin/wmtest-helper-log
RUN chmod ugo+x /etc/wingmate/services/one && chmod ugo+x /etc/wingmate/services/two.sh && \
chmod ugo-x /etc/wingmate/services/three.sh
ADD docker/alpine/etc/ /etc/
RUN chmod -R ugo+x /etc/wingmate
CMD [ "/usr/local/bin/init" ]

View File

@ -1,3 +1,3 @@
17 * * * * sleep 1
*/12 * * * * sleep 1
12,17,27 * * * * sleep 1
17 * * * * /etc/wingmate/crontab.d/cron1.sh
*/5 * * * * /etc/wingmate/crontab.d/cron2.sh
21,41 3,6,14,17,20,22 * * * /etc/wingmate/crontab.d/cron3.sh

View File

@ -0,0 +1,3 @@
#!/bin/sh
exec wmtest-helper-log /var/log/cron1.log "this cron runs every hour on minute 17"

View File

@ -0,0 +1,3 @@
#!/bin/sh
exec wmtest-helper-log /var/log/cron2.log "this cron runs every hour on minute 5,10,15,20,25,30,35,40,45,50,55"

View File

@ -0,0 +1,3 @@
#!/bin/sh
exec wmtest-helper-log /var/log/cron3.log "this cron runs based on this specification: 21,41 3,6,14,17,20,22 * * *"

View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
exec sleep 1

View File

@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
exec sleep 1