1
0
mirror of https://github.com/shimunn/gitredditor.git synced 2023-11-17 18:42:43 +01:00

include gitstats

This commit is contained in:
shimunn 2019-05-23 17:49:49 +02:00
parent 37248f2ecd
commit 4efd64f165
3 changed files with 11 additions and 4 deletions

View File

@ -23,13 +23,17 @@ RUN cargo build --release
FROM ubuntu
RUN apt update && apt install -y libcurl3 git -y && rm -rf /var/lib/{apt,dpkg,cache,log}
RUN apt update && apt install -y libcurl3 git gitstats -y && rm -rf /var/lib/{apt,dpkg,cache,log}
COPY --from=build /usr/src/gitredditor/target/release/gitredditor /usr/local/bin
COPY --from=fs /usr/src/gitredditor/src /usr/src/gitredditor/src
VOLUME /repo
COPY --from=fs /usr/src/gitredditor/stats.sh /usr/local/bin/gitredditor-stats
RUN chmod +x /usr/local/bin/gitredditor-stats
VOLUME /repo /stats
WORKDIR /repo

View File

@ -15,8 +15,8 @@ Restart=always
ExecStartPre=/bin/bash -c "cd ${ROOT_DIR}/${GITREDDITOR_U} && /usr/bin/git pull"
ExecStart=/usr/bin/rkt --insecure-options=image run --inherit-env --dns 8.8.8.8 --volume volume-repo,kind=host,source=${ROOT_DIR}/${GITREDDITOR_U} \
docker://repo.shimun.net/shimun/gitredditor
ExecStart=/usr/bin/rkt --insecure-options=image run --inherit-env --dns 8.8.8.8 --volume volume-repo,kind=host,source=${ROOT_DIR}/${GITREDDITOR_U} --volume volume-stats,kind=host,source=${ROOT_DIR}/stats/${GITREDDITOR_U} \
docker://repo.shimun.net/shimun/gitredditor --exec sh -- -c 'gitredditor && gitredditor-stats'
ExecStopPost=/bin/bash -c "cd ${ROOT_DIR}/${GITREDDITOR_U} && /usr/bin/git push"

3
stats.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
gitstats -c project_name=reddit -c processes=1 /repo /stats