|
3 | 3 | ########## |
4 | 4 | FROM golang:1.24-bookworm AS builder |
5 | 5 |
|
6 | | -ARG IGNITE_VERSION=latest |
7 | | -ARG IGNITE_EVOLVE_APP_VERSION=main |
8 | | -ARG EVNODE_VERSION=v1.0.0-beta.2 |
9 | | - |
| 6 | +# Install system dependencies - this layer will be cached |
10 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
11 | 8 | git curl bash ca-certificates make gcc musl-dev && \ |
12 | 9 | rm -rf /var/lib/apt/lists/* |
13 | 10 |
|
14 | | -# Install Ignite CLI at requested version |
| 11 | +# Install Ignite CLI at requested version - cached if IGNITE_VERSION doesn't change |
| 12 | +ARG IGNITE_VERSION=latest |
15 | 13 | RUN curl -sSL https://get.ignite.com/cli@${IGNITE_VERSION}! | bash |
16 | 14 |
|
17 | 15 | WORKDIR /workspace |
18 | 16 |
|
19 | | -# Copy ev-abci repo (root) |
20 | | -COPY . /workspace/ev-abci |
21 | | - |
22 | | -# Scaffold GM app and apply evolve plugin |
| 17 | +# Scaffold GM app - cached if IGNITE_EVOLVE_APP_VERSION doesn't change |
| 18 | +ARG IGNITE_EVOLVE_APP_VERSION=main |
23 | 19 | RUN ignite scaffold chain gm --no-module --skip-git --address-prefix gm |
24 | 20 | WORKDIR /workspace/gm |
25 | 21 | RUN ignite app install github.com/ignite/apps/evolve@${IGNITE_EVOLVE_APP_VERSION} |
26 | 22 | RUN ignite evolve add |
27 | 23 |
|
| 24 | +# Copy ev-abci repo after scaffolding to avoid cache invalidation on code changes |
| 25 | +COPY . /workspace/ev-abci |
| 26 | + |
28 | 27 | # Inject App wiring for ev-abci network module before building |
29 | 28 | COPY .github/integration-tests/patches/app-wiring/patch-app-wiring.sh /workspace/patch-app-wiring.sh |
30 | 29 | RUN chmod +x /workspace/patch-app-wiring.sh && \ |
31 | 30 | echo "===== Running network module patch =====" && \ |
32 | 31 | bash /workspace/patch-app-wiring.sh |
33 | 32 |
|
34 | | - |
35 | | -# Align module versions like in CI |
| 33 | +# Align module versions like in CI - cached if EVNODE_VERSION doesn't change |
| 34 | +ARG EVNODE_VERSION=v1.0.0-beta.2 |
36 | 35 | RUN go mod edit -replace github.com/evstack/ev-node=github.com/evstack/ev-node@${EVNODE_VERSION} \ |
37 | 36 | && go mod edit -replace github.com/evstack/ev-abci=../ev-abci \ |
38 | 37 | && go mod tidy |
39 | 38 |
|
40 | | -# Build gmd binary |
| 39 | +# Build gmd binary - this will rebuild if source code changes |
41 | 40 | ENV GOBIN=/workspace/bin |
42 | 41 | RUN ignite chain build --skip-proto && \ |
43 | 42 | test -x "${GOBIN}/gmd" |
|
0 commit comments