docker: fix git path, add log

This commit is contained in:
dongdigua 2023-05-29 11:18:04 +08:00
parent 32b91437be
commit 2e172d44cc
3 changed files with 14 additions and 5 deletions

View File

@ -2,12 +2,20 @@ FROM alpine:latest
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& sed -i 'a https://mirrors.tuna.tsinghua.edu.cn/alpine/edge/testing' /etc/apk/repositories \ && sed -i 'a https://mirrors.tuna.tsinghua.edu.cn/alpine/edge/testing' /etc/apk/repositories \
&& apk add agate git && apk add agate git \
&& touch /var/log/git.log
RUN git clone https://github.com/dongdigua/dongdigua.github.io.git --depth 1 RUN git clone https://github.com/dongdigua/dongdigua.github.io.git --depth 1
COPY run-wrapper.sh . COPY run-wrapper.sh .
# https://weinan.io/2019/04/06/cron.html
COPY update-git.sh /etc/periotic/daily/ COPY update-git.sh /etc/periotic/daily/
# for testing purpose only
# RUN mkdir /etc/periodic/1min \
# && echo "*/1 * * * * run-parts /etc/periodic/1min" \
# >> /var/spool/cron/crontabs/root
# COPY update-git.sh /etc/periodic/1min/
CMD [ "./run-wrapper.sh" ] CMD [ "./run-wrapper.sh" ]

View File

@ -1,7 +1,8 @@
#! /bin/sh #! /bin/sh
crond -f & crond -f -d 8 &
agate --content dongdigua.github.io/gmi --hostname $GEMINI_HOST tail -f /var/log/git.log &
agate --content dongdigua.github.io/gmi -e --hostname $GEMINI_HOST
wait -n wait -n
echo $? echo $?

View File

@ -1,4 +1,4 @@
#! /bin/sh #! /bin/sh
cd dongdigua.github.io cd /dongdigua.github.io
git pull --rebase git pull --rebase >> /var/log/git.log 2>&1