Skip to content

Commit

Permalink
build: more precise COPY to invalidate less
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Nov 6, 2023
1 parent f0023c8 commit 292e8bc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions makeDockerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ENV UPGRADE_TO=${to} THIS_NAME=${agZeroUpgrade}
# put env functions into shell environment
RUN echo '. /usr/src/upgrade-test-scripts/env_setup.sh' >> ~/.bashrc
COPY --link --chmod=755 ./upgrade-test-scripts /usr/src/upgrade-test-scripts
COPY --link --chmod=755 ./upgrade-test-scripts/env_setup.sh ./upgrade-test-scripts/start_ag0.sh /usr/src/upgrade-test-scripts/
SHELL ["/bin/bash", "-c"]
# this is the only layer that starts ag0
RUN /usr/src/upgrade-test-scripts/start_ag0.sh
Expand All @@ -51,7 +51,7 @@ RUN /usr/src/upgrade-test-scripts/start_ag0.sh
FROM use-${lastProposal.proposalName} as prepare-${proposalName}
ENV UPGRADE_TO=${planName}
# base is a fresh sdk image so copy these supports
COPY --link --chmod=755 ./upgrade-test-scripts/*.sh /usr/src/upgrade-test-scripts/
COPY --link --chmod=755 ./upgrade-test-scripts/env_setup.sh ./upgrade-test-scripts/start_to_to.sh /usr/src/upgrade-test-scripts/
WORKDIR /usr/src/upgrade-test-scripts
SHELL ["/bin/bash", "-c"]
Expand All @@ -70,7 +70,7 @@ FROM ghcr.io/agoric/agoric-sdk:${sdkImageTag} as execute-${proposalName}
ENV THIS_NAME=${planName}
# base is a fresh sdk image so copy these supports
COPY --link --chmod=755 ./upgrade-test-scripts/*.sh /usr/src/upgrade-test-scripts/
COPY --link --chmod=755 ./upgrade-test-scripts/env_setup.sh ./upgrade-test-scripts/start_to_to.sh /usr/src/upgrade-test-scripts/
COPY --link --from=prepare-${proposalName} /root/.agoric /root/.agoric
Expand Down Expand Up @@ -112,8 +112,9 @@ FROM ${previousStage}-${proposalName} as use-${proposalName}
COPY --link --chmod=755 ./proposals/${proposalIdentifier}:${proposalName} /usr/src/proposals/${proposalIdentifier}:${proposalName}
COPY --link --chmod=755 ./upgrade-test-scripts/run_use.sh /usr/src/upgrade-test-scripts/run_use.sh
# XXX for 'lib' dir for JS modules
COPY --link --chmod=755 ./upgrade-test-scripts /usr/src/upgrade-test-scripts/
COPY --link ./upgrade-test-scripts/lib /usr/src/upgrade-test-scripts/lib
# TODO remove network dependencies in stages
RUN cd /usr/src/upgrade-test-scripts/lib/ && yarn install
Expand All @@ -135,6 +136,8 @@ RUN ./run_use.sh ${proposalIdentifier}:${proposalName}
# TEST ${proposalName}
FROM use-${proposalName} as test-${proposalName}
COPY --link --chmod=755 ./upgrade-test-scripts/run_test.sh /usr/src/upgrade-test-scripts/run_test.sh
WORKDIR /usr/src/upgrade-test-scripts
SHELL ["/bin/bash", "-c"]
ENTRYPOINT ./run_test.sh ${proposalIdentifier}:${proposalName}
Expand All @@ -148,6 +151,8 @@ ENTRYPOINT ./run_test.sh ${proposalIdentifier}:${proposalName}
# DEFAULT
FROM use-${lastProposal.proposalName}
COPY --link --chmod=755 ./upgrade-test-scripts/start_agd.sh /usr/src/upgrade-test-scripts/start_agd.sh
WORKDIR /usr/src/upgrade-test-scripts
SHELL ["/bin/bash", "-c"]
ENTRYPOINT ./start_agd.sh
Expand Down

0 comments on commit 292e8bc

Please sign in to comment.