Skip to content

Commit

Permalink
Merge pull request #2660 from newrelic-forks/feat/speedier-e2e-image-…
Browse files Browse the repository at this point in the history
…builds

🏃 speed up e2e image builds
  • Loading branch information
k8s-ci-robot authored Mar 13, 2020
2 parents a433c40 + 866bece commit f11383e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ scripts/
tilt-settings.json
tilt.d/
Tiltfile
**/.tiltbuild
test/infrastructure/docker/e2e/logs/**
**/config/**/*.yaml
_artifacts
6 changes: 3 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ FROM gcr.io/distroless/base:debug as tilt
WORKDIR /
COPY --from=tilt-helper /start.sh .
COPY --from=tilt-helper /restart.sh .
COPY .tiltbuild/manager .
COPY manager .
"""

# Configures a provider by doing the following:
Expand Down Expand Up @@ -160,11 +160,11 @@ def enable_provider(name):
# build into the container.
docker_build(
ref = p.get("image"),
context = context,
context = context + "/.tiltbuild/",
dockerfile_contents = dockerfile_contents,
target = "tilt",
entrypoint = ["sh", "/start.sh", "/manager"],
only = ".tiltbuild/manager",
only = "manager",
live_update = [
sync(context + "/.tiltbuild/manager", "/manager"),
run("sh /restart.sh"),
Expand Down
14 changes: 14 additions & 0 deletions test/infrastructure/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ FROM golang:1.13.8 as builder
ARG goproxy=https://proxy.golang.org
ENV GOPROXY=$goproxy

WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum

# Essentially, change directories into CAPD
WORKDIR /workspace/test/infrastructure/docker
# Copy the Go Modules manifests
COPY test/infrastructure/docker/go.mod go.mod
COPY test/infrastructure/docker/go.sum go.sum

# Cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

# This needs to build with the entire Cluster API context
WORKDIR /workspace
# Copy in cluster-api (which includes the test/infrastructure/docker subdirectory)
Expand Down

0 comments on commit f11383e

Please sign in to comment.