From 4a9c0cff313b7b2d588e8012b6a4590db2a2e7a9 Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Wed, 11 Dec 2024 20:53:30 -0500 Subject: [PATCH] tilt: better cli-gen and const-gen scope --- Tiltfile | 8 +++++--- aptos/Makefile | 2 +- clients/js/.dockerignore | 2 ++ Dockerfile.cli => clients/js/Dockerfile | 4 ++-- sui/Makefile | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 clients/js/.dockerignore rename Dockerfile.cli => clients/js/Dockerfile (85%) diff --git a/Tiltfile b/Tiltfile index 7a7f51c40e..1fbc48b29b 100644 --- a/Tiltfile +++ b/Tiltfile @@ -124,15 +124,17 @@ def k8s_yaml_with_ns(objects): docker_build( ref = "cli-gen", - context = ".", - dockerfile = "Dockerfile.cli", + context = "clients/js", + dockerfile = "clients/js/Dockerfile", + ignore = ["build","node_modules"], ) docker_build( ref = "const-gen", context = ".", dockerfile = "Dockerfile.const", - build_args={"num_guardians": '%s' % (num_guardians)}, + build_args = {"num_guardians": '%s' % (num_guardians)}, + only = ["scripts", "ethereum/.env.test"] ) # node diff --git a/aptos/Makefile b/aptos/Makefile index 1fd96377df..768292e0d4 100644 --- a/aptos/Makefile +++ b/aptos/Makefile @@ -7,6 +7,6 @@ $(TARGETS): $(foreach dir,$(CONTRACT_DIRS), make -C $(dir) $@ &&) true test-docker: - DOCKER_BUILDKIT=1 docker build --progress plain -f ../Dockerfile.cli -t cli-gen .. + DOCKER_BUILDKIT=1 docker build --progress plain -f ../clients/js/Dockerfile -t cli-gen ../clients/js DOCKER_BUILDKIT=1 docker build --build-arg num_guardians=1 --progress plain -f ../Dockerfile.const -t const-gen .. DOCKER_BUILDKIT=1 docker build --progress plain -f Dockerfile --target tests . diff --git a/clients/js/.dockerignore b/clients/js/.dockerignore new file mode 100644 index 0000000000..e3fbd98336 --- /dev/null +++ b/clients/js/.dockerignore @@ -0,0 +1,2 @@ +build +node_modules diff --git a/Dockerfile.cli b/clients/js/Dockerfile similarity index 85% rename from Dockerfile.cli rename to clients/js/Dockerfile index 3d5b35c672..a5e173080c 100644 --- a/Dockerfile.cli +++ b/clients/js/Dockerfile @@ -2,14 +2,14 @@ FROM node:18-alpine@sha256:44aaf1ccc80eaed6572a0f2ef7d6b5a2982d54481e4255480041ac92221e2f11 as cli-build # Copy package.json & package-lock.json by themselves to create a cache layer -COPY clients/js/package.json clients/js/package-lock.json /clients/js/ +COPY package.json package-lock.json /clients/js/ WORKDIR /clients/js RUN npm ci # Copy the rest of the source files, as a layer on top of the deps -COPY clients/js /clients/js +COPY . /clients/js # Build CLI RUN npm run build diff --git a/sui/Makefile b/sui/Makefile index 0ee0e5eb94..0549a0881e 100644 --- a/sui/Makefile +++ b/sui/Makefile @@ -10,6 +10,6 @@ test: $(foreach dir,$(TEST_CONTRACT_DIRS), make -C $(dir) $@ &&) true test-docker: - DOCKER_BUILDKIT=1 docker build --progress plain -f ../Dockerfile.cli -t cli-gen .. + DOCKER_BUILDKIT=1 docker build --progress plain -f ../clients/js/Dockerfile -t cli-gen ../clients/js DOCKER_BUILDKIT=1 docker build --build-arg num_guardians=1 --progress plain -f ../Dockerfile.const -t const-gen .. DOCKER_BUILDKIT=1 docker build -f Dockerfile ..