Skip to content

Commit d46835f

Browse files
authored
Merge pull request #494 from sir-gon/develop
[Docker] a little performance increase in (re)build time and note added.
2 parents bd53e18 + 5191189 commit d46835f

File tree

3 files changed

+41
-10
lines changed

3 files changed

+41
-10
lines changed

Dockerfile

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,44 @@ FROM base AS lint
1010
ENV WORKDIR=/app
1111
WORKDIR ${WORKDIR}
1212

13-
COPY ./src ${WORKDIR}/src
1413
RUN apk add --update --no-cache make nodejs npm
1514
RUN apk add --update --no-cache yamllint
1615

1716
RUN npm install -g --ignore-scripts markdownlint-cli
1817
RUN npm install -g --ignore-scripts pyright
1918

19+
# [!TIP] Use a bind-mount to "/app" to override following "copys"
20+
# for lint and test against "current" sources in this stage
21+
22+
# YAML sources
23+
COPY ./.github ${WORKDIR}/
24+
COPY ./compose.yaml ${WORKDIR}/
25+
26+
# Markdown sources
27+
COPY ./docs ${WORKDIR}/
28+
COPY ./README.md ${WORKDIR}/
29+
COPY ./LICENSE.md ${WORKDIR}/
30+
COPY ./CODE_OF_CONDUCT.md ${WORKDIR}/
31+
32+
# Code source
33+
COPY ./src ${WORKDIR}/
34+
COPY ./requirements.txt ${WORKDIR}/
35+
COPY ./setup.cfg ${WORKDIR}/
36+
COPY ./Makefile ${WORKDIR}/
37+
38+
# markdownlint conf
39+
COPY ./.markdownlint.yaml ${WORKDIR}/
40+
41+
# yamllint conf
42+
COPY ./.yamllint ${WORKDIR}/
43+
COPY ./.yamlignore ${WORKDIR}/
44+
45+
# pylint and covergae
46+
COPY ./.pylintrc ${WORKDIR}/
47+
COPY ./.coveragerc ${WORKDIR}/
48+
49+
CMD ["make", "lint"]
50+
2051
###############################################################################
2152
FROM base AS development
2253

@@ -46,7 +77,6 @@ ENV BRUTEFORCE=false
4677

4778
WORKDIR /app
4879

49-
COPY ./.pylintrc ${WORKDIR}/
5080
COPY ./.coveragerc ${WORKDIR}/
5181
RUN ls -alh
5282

@@ -68,8 +98,6 @@ RUN chown worker:worker /app
6898

6999
WORKDIR /app
70100

71-
COPY ./.pylintrc ${WORKDIR}/
72-
COPY ./.coveragerc ${WORKDIR}/
73101
RUN ls -alh
74102

75103
USER worker

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MIT License
1+
# MIT License
22

33
Copyright (c) 2022 Gonzalo Diaz
44

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,17 @@ test/styling: dependencies
8282
${RUNTIME_TOOL} -m pycodestyle --statistics src/
8383

8484
test: env dependencies
85-
${RUNTIME_TOOL} -m pytest --verbose -o log_cli=true --log-cli-level=${LOG_LEVEL} --full-trace src/
85+
${RUNTIME_TOOL} -m coverage run -m \
86+
pytest --verbose \
87+
-o log_cli=true \
88+
--log-cli-level=${LOG_LEVEL} \
89+
--full-trace src/
90+
${RUNTIME_TOOL} -m coverage report
8691

87-
coverage: dependencies
88-
${RUNTIME_TOOL} -m coverage run -m pytest --verbose src/
92+
coverage: test
8993
${RUNTIME_TOOL} -m coverage lcov -o coverage/lcov.info
90-
${RUNTIME_TOOL} -m coverage report
9194

92-
coverage/html: coverage
95+
coverage/html: test
9396
${RUNTIME_TOOL} -m coverage html
9497

9598
outdated:

0 commit comments

Comments
 (0)