mirror of
https://github.com/dongdigua/dongdigua.github.io
synced 2025-02-20 11:29:15 +08:00
docker: git Date filter
This commit is contained in:
parent
1566d6a9dc
commit
a49b18355f
@ -2,14 +2,16 @@ FROM alpine:latest
|
||||
|
||||
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 \
|
||||
&& apk add agate git python3 \
|
||||
&& touch /var/log/git.log
|
||||
|
||||
RUN git clone https://github.com/dongdigua/dongdigua.github.io.git --depth 1 \
|
||||
&& apk add agate git python3 perl \
|
||||
&& touch /var/log/git.log \
|
||||
&& echo "0 * * * * run-parts /etc/periodic/hourly" > /var/spool/cron/crontabs/root
|
||||
|
||||
RUN git clone https://github.com/dongdigua/dongdigua.github.io.git --depth 1 \
|
||||
&& cd dongdigua.github.io \
|
||||
&& git config filter.dater.smudge 'perl -pe "\$last_date = `git log --pretty=format:\\"%ad\\" -1`;s/\\\$Date\\\$/\\\$Date: \$last_date\\\$/"' \
|
||||
&& git config filter.dater.clean 'perl -pe "s/\\\$Date[^\\\$]*\\\$/\\\$Date\\\$/"' \
|
||||
|
||||
COPY run-wrapper.sh .
|
||||
# https://weinan.io/2019/04/06/cron.html
|
||||
COPY update-git.sh /etc/periodic/hourly/
|
||||
|
||||
# for testing purpose only
|
||||
|
@ -1,5 +1,9 @@
|
||||
# Docker & Gemini
|
||||
|
||||
## System
|
||||
alpine linux
|
||||
=> https://weinan.io/2019/04/06/cron.html cron
|
||||
|
||||
## Server Program
|
||||
=> https://github.com/mbrubeck/agate agate
|
||||
|
||||
|
10
gmi/git_filter_dater.gmi
Normal file
10
gmi/git_filter_dater.gmi
Normal file
@ -0,0 +1,10 @@
|
||||
# gitattributes filter=dater
|
||||
|
||||
better than the ruby solution in ProGit
|
||||
=> https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes 8.2 Customizing Git - Git Attributes
|
||||
|
||||
(do not run it in fish shell, use bash/ksh instead)
|
||||
```
|
||||
git config filter.dater.smudge 'perl -pe "\$last_date = `git log --pretty=format:\\"%ad\\" -1`;s/\\\$Date\\\$/\\\$Date: \$last_date\\\$/"'
|
||||
git config filter.dater.clean 'perl -pe "s/\\\$Date[^\\\$]*\\\$/\\\$Date\\\$/"'
|
||||
```
|
Loading…
Reference in New Issue
Block a user