Skip to content

Commit

Permalink
Cache corepack resources
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin A. Ruder <signed@mruder.dev>
  • Loading branch information
marvinruder committed Feb 29, 2024
1 parent 1b865e1 commit f8958f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ node('rating-tracker-build') {
sh """
echo \"enableInlineBuilds: true\" >> .yarnrc.yml
echo \"globalFolder: /workdir/cache/yarn/global\" >> .yarnrc.yml
mkdir -p \$HOME/.cache/yarn \$HOME/.cache/prisma ./cache
cp -arln \$HOME/.cache/yarn \$HOME/.cache/prisma ./cache || :
mkdir -p \$HOME/.cache/yarn \$HOME/.cache/node \$HOME/.cache/prisma ./cache
cp -arln \$HOME/.cache/yarn \$HOME/.cache/node \$HOME/.cache/prisma ./cache || :
docker build $DOCKER_CI_FLAGS --target=yarn .
"""
}
Expand Down Expand Up @@ -125,7 +125,7 @@ node('rating-tracker-build') {
stage ('Cleanup') {
// Upload cache to external storage and remove build artifacts
sh """#!/bin/bash
cp -arln ./cache/yarn ./cache/prisma \$HOME/.cache
cp -arln ./cache/yarn ./cache/node \$HOME/.cache/prisma \$HOME/.cache
putcache
PGPORT=$PGPORT REDISPORT=$REDISPORT docker compose -p rating-tracker-test-job$JOB_ID -f packages/backend/test/docker-compose.yml down -t 0
docker rmi $IMAGE_NAME:job$JOB_ID-wasm $IMAGE_NAME:job$JOB_ID-ci || :
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile-ci
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ WORKDIR /coverage
# Copy coverage reports from test stage
COPY --from=test /coverage /coverage

# Add yarn and prisma cache
# Add caches
COPY --from=yarn /root/.cache /cache
COPY --from=yarn /workdir/cache/yarn /cache/yarn
COPY --from=yarn /root/.cache/prisma /cache/prisma

# Add build artifacts
COPY --from=build /app /app
Expand Down

0 comments on commit f8958f8

Please sign in to comment.