radn-dev/xmetrics/Dockerfile
2023-08-02 04:57:19 +00:00

136 lines
4.2 KiB
Docker

FROM python:3.11 as metrics-base
WORKDIR /code/
FROM metrics-base as metrics-tmg
RUN git clone https://github.com/OnGoTeam/TMGmod.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 82db35f2db92572c98d84ef781f64f8d65d2f023
ENV SRCDIR="build/src"
ENV SRCPATTERN="*.cs"
FROM metrics-base as metrics-radn
RUN git clone https://gitea.parrrate.ru/PTV/radn-rs.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 1a8d70957b7d0f3f08f1c0f11ff04ebc007a6b48
FROM metrics-base as metrics-mdbook
RUN git clone https://github.com/rust-lang/mdBook.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 904aa530b5f59387f19feb0dbe0e959de3f247d2
FROM metrics-base as metrics-rustup
RUN git clone https://github.com/rust-lang/rustup.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 849adb7c1b8c97e4145e350a934c3a665f61798e
FROM metrics-base as metrics-cargo
RUN git clone https://github.com/rust-lang/cargo.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 5b377cece0e0dd0af686cf53ce4637d5d85c2a10
FROM metrics-base as metrics-rust
RUN git clone https://github.com/rust-lang/rust.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 32d81eccd64513bacef9dfa1574543ada6b45d85
FROM metrics-base as metrics-ocen
RUN git clone https://github.com/ocen-lang/ocen.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout 0b1a63d0e141fc3032f10c70b5cae117429e2dcb
ENV SRCDIR="."
ENV SRCPATTERN="*.[oa][ec]"
FROM metrics-base as metrics-aecor
RUN git clone https://github.com/mustafaquraish/aecor.git repo
WORKDIR /code/repo/
RUN git fetch && git checkout f81543a34ee363dcc00e8632fd7cfcd4a3478b23
ENV SRCDIR="."
ENV SRCPATTERN="*.[ach]*"
FROM metrics-cargo as metrics-repo
FROM metrics-repo as metrics-commits
COPY common.py /code/common.py
COPY commits.py /code/commits.py
RUN python3 /code/commits.py
FROM metrics-repo as metrics
COPY common.py /code/common.py
COPY metrics.py /code/metrics.py
COPY --from=metrics-commits /code/commits.dat commits.dat
RUN python3 /code/metrics.py
FROM python:3.11 as metrics-process
RUN python3 -m pip install numpy
WORKDIR /code/
FROM metrics-process as metrics-data
COPY --from=metrics /code/metrics.dat metrics.dat
FROM metrics-process as metrics-plot
RUN python3 -m pip install matplotlib
FROM metrics-data as metrics-entries
COPY entries.py entries.py
RUN python3 entries.py
FROM metrics-data as metrics-y
COPY cors.py cors.py
RUN python3 cors.py
FROM metrics-plot as metrics-c
COPY --from=metrics-y /code/Y.dat Y.dat
COPY k2c.py k2c.py
FROM metrics-c as metrics-c-linear
COPY c_linear.py c_linear.py
RUN python3 c_linear.py
FROM metrics-c as metrics-c-proportional
COPY c_proportional.py c_proportional.py
RUN python3 c_proportional.py
FROM metrics-process as metrics-x-linear
COPY --from=metrics-y /code/Y.dat Y.dat
COPY x_linear.py x_linear.py
RUN python3 x_linear.py
FROM metrics-process as metrics-x-proportional
COPY --from=metrics-y /code/Y.dat Y.dat
COPY x_proportional.py x_proportional.py
RUN python3 x_proportional.py
FROM metrics-plot as metrics-render
RUN mkdir /code/metrics/
FROM metrics-render as metrics-render-ploc
COPY --from=metrics-entries /code/entries.dat entries.dat
COPY render_ploc.py render_ploc.py
RUN python3 render_ploc.py
FROM metrics-render as metrics-render-hist
COPY --from=metrics-y /code/Y.dat Y.dat
COPY render_hist.py render_hist.py
FROM metrics-render-hist as metrics-render-01x
COPY --from=metrics-x-linear /code/X.dat X.dat
COPY --from=metrics-c-linear /code/C.dat C.dat
RUN python3 render_hist.py
FROM metrics-render-hist as metrics-render-02y
COPY --from=metrics-x-linear /code/X.dat X.dat
COPY --from=metrics-c-proportional /code/C.dat C.dat
RUN python3 render_hist.py
FROM metrics-render-hist as metrics-render-03xy
COPY --from=metrics-x-proportional /code/X.dat X.dat
COPY --from=metrics-c-proportional /code/C.dat C.dat
RUN python3 render_hist.py
FROM metrics-render
COPY --from=metrics-y /code/Y.dat Y.dat
COPY --from=metrics-render-ploc /code/metrics/out.png /code/metrics/metrics.png
COPY --from=metrics-render-01x /code/metrics/out.png /code/metrics/metrics-01x.png
COPY --from=metrics-render-02y /code/metrics/out.png /code/metrics/metrics-02y.png
COPY --from=metrics-render-03xy /code/metrics/out.png /code/metrics/metrics-03xy.png