Skip to content

Commit b996f4f

Browse files
Use docker layers cache for ctst
1 parent 995dcc0 commit b996f4f

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

tests/ctst/Dockerfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@ FROM ghcr.io/scality/zenko-drctl:$DRCTL_TAG AS drctl
77
FROM ghcr.io/scality/cli-testing:$CTST_TAG
88

99
COPY package.json /tmp/package.json
10+
11+
USER root
12+
RUN npm install typescript@5.8.3 -g
13+
14+
# CTST does it if needed, but better to merge dependencies
15+
# here so we benefit from Docker layer caching
16+
WORKDIR /ctst
17+
RUN merge-packages /tmp/package.json package.json --output package.json && \
18+
jq 'del(.devDependencies)' package.json > package.json.tmp && \
19+
mv package.json.tmp package.json && \
20+
echo "Merged package.json:" && cat package.json && \
21+
yarn install --prod --network-concurrency=1 && \
22+
yarn cache clean && \
23+
echo "Dependencies pre-installed at build time - runtime will skip installation" && \
24+
touch .init
25+
1026
COPY ./features /ctst/features
1127
COPY ./common /ctst/common
1228
COPY ./steps /ctst/steps
1329
COPY ./world /ctst/world
1430

15-
USER root
16-
RUN npm install typescript@5.8.3 -g
17-
1831
RUN chmod 0777 -R /tmp/
1932
RUN chmod 0777 -R /ctst/
2033

2134
ENV SDK=true
2235

23-
WORKDIR /ctst
24-
2536
COPY --from=sorbet /sorbetctl .
2637
COPY --from=drctl /zenko-drctl .
2738

0 commit comments

Comments
 (0)