Skip to content

Commit

Permalink
test cache busting
Browse files Browse the repository at this point in the history
  • Loading branch information
p-shahi committed Dec 10, 2024
1 parent 586bd6f commit 57a6c90
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions transport-interop/impl/js/v2.x/BrowserDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ FROM mcr.microsoft.com/playwright
COPY --from=js-libp2p-base /app/ /app/
WORKDIR /app

ARG CACHE_BUST=1
ENV CACHE_BUST=$CACHE_BUST

# We install browsers here instead of the cached version so that we use the latest browsers at run time.
# Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it.
# By installing here, we avoid installing it at test time.
Expand Down
3 changes: 3 additions & 0 deletions transport-interop/impl/js/v2.x/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ FROM node:lts

WORKDIR /app

ARG CACHE_BUST=1
ENV CACHE_BUST=$CACHE_BUST

COPY package*.json .aegir.js tsconfig.json ./
COPY src ./src
COPY test ./test
Expand Down
6 changes: 3 additions & 3 deletions transport-interop/impl/js/v2.x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ load-image-json: image.json
docker image tag $$(jq -r .imageID image.json) ${image_name}

chromium-image.json: load-image-json BrowserDockerfile
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=${image_name} --build-arg=BROWSER=chromium -t chromium-${image_name} .
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=${image_name} --build-arg=BROWSER=chromium --build-arg CACHE_BUST=$(date +%s) -t chromium-${image_name} .
docker image inspect chromium-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

firefox-image.json: load-image-json BrowserDockerfile
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=${image_name} --build-arg=BROWSER=firefox -t firefox-${image_name} .
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=${image_name} --build-arg=BROWSER=firefox --build-arg CACHE_BUST=$(date +%s) -t firefox-${image_name} .
docker image inspect firefox-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

Expand All @@ -25,7 +25,7 @@ update-lock-file: image.json
docker rm $$CONTAINER_ID

image.json:
docker build -t ${image_name} -f ./Dockerfile .
docker build --build-arg CACHE_BUST=$(date +%s) -t ${image_name} -f ./Dockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

Expand Down
3 changes: 0 additions & 3 deletions transport-interop/impl/js/v2.x/test/fixtures/relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ export async function createRelay (): Promise<Libp2p> {

return server
}

// why is this comment necessary?
// it seems to bust a mystery cache used by CI

0 comments on commit 57a6c90

Please sign in to comment.