-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a66711
commit d204c00
Showing
3 changed files
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
image_name := js-v0.46 | ||
image_name := js-libp2p-head | ||
TEST_SOURCES := $(wildcard test/*.ts) | ||
|
||
# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in | ||
all: node-image.json chromium-image.json firefox-image.json update-lock-file | ||
# Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in | ||
# all: node-image.json webkit-image.json firefox-image.json chromium-image.json | ||
all: node-image.json firefox-image.json chromium-image.json | ||
|
||
# Necessary because multistage builds require a docker image name rather than a digest to be used | ||
load-image-json: node-image.json | ||
docker image tag $$(jq -r .imageID node-image.json) ${image_name} | ||
node-image.json: Dockerfile $(TEST_SOURCES) package.json .aegir.js | ||
cd .. && docker build -f interop/Dockerfile -t node-${image_name} . | ||
docker image inspect node-${image_name} -f "{{.Id}}" | \ | ||
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ | ||
|
||
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} . | ||
chromium-image.json: node-image.json BrowserDockerfile $(TEST_SOURCES) package.json .aegir.js | ||
cd .. && docker build -f interop/BrowserDockerfile --build-arg=BROWSER=chromium -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} . | ||
firefox-image.json: node-image.json BrowserDockerfile $(TEST_SOURCES) package.json .aegir.js | ||
cd .. && docker build -f interop/BrowserDockerfile --build-arg=BROWSER=firefox -t firefox-${image_name} . | ||
docker image inspect firefox-${image_name} -f "{{.Id}}" | \ | ||
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ | ||
|
||
# We update the lock file here so that we make sure we are always using the correct lock file. | ||
# If this changes, CI will fail since there are unstaged changes. | ||
update-lock-file: node-image.json | ||
CONTAINER_ID=$$(docker create $$(jq -r .imageID node-image.json)); \ | ||
docker cp $$CONTAINER_ID:/app/package-lock.json ./package-lock.json; \ | ||
docker rm $$CONTAINER_ID | ||
|
||
image.json: | ||
docker build -t ${image_name} -f ./Dockerfile . | ||
docker image inspect ${image_name} -f "{{.Id}}" | \ | ||
webkit-image.json: node-image.json BrowserDockerfile $(TEST_SOURCES) package.json .aegir.js | ||
cd .. && docker build -f interop/BrowserDockerfile --build-arg=BROWSER=webkit -t webkit-${image_name} . | ||
docker image inspect webkit-${image_name} -f "{{.Id}}" | \ | ||
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ | ||
|
||
clean: | ||
rm -rf *-image.json | ||
.PHONY: clean | ||
|
||
.PHONY: all clean browser-images load-image-json | ||
clean: | ||
rm *image.json |