Skip to content

Commit

Permalink
fix: replace hardcoded image pull registry URLs with box config (#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
malept authored Aug 27, 2024
1 parent 20e51bf commit 0ab77ef
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ toolchain go1.22.6

require (
github.com/blang/semver/v4 v4.0.0
github.com/getoutreach/gobox v1.92.1
github.com/getoutreach/stencil v1.39.1
github.com/getoutreach/gobox v1.95.0
github.com/getoutreach/stencil v1.40.0-rc.1
github.com/google/go-cmp v0.6.0
github.com/magefile/mage v1.15.0
github.com/pkg/errors v0.9.1
Expand All @@ -30,7 +30,7 @@ require (
github.com/chainguard-dev/git-urls v1.0.2 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/danieljoos/wincred v1.2.1 // indirect
github.com/danieljoos/wincred v1.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.17.0 // indirect
Expand Down Expand Up @@ -71,15 +71,15 @@ require (
github.com/spf13/cast v1.4.1 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/zalando/go-keyring v0.2.4 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
github.com/zalando/go-keyring v0.2.5 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
Expand Down
56 changes: 28 additions & 28 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ RUN --mount=type=ssh --mount=type=cache,target=/go/pkg go mod download
# Build our application, caching the go build cache, but also using
# the dependency cache from earlier.
RUN --mount=type=ssh --mount=type=cache,target=/go/pkg --mount=type=cache,target=/go-build-cache \
mkdir -p bin; \
go build -o /src/bin/ -ldflags "-X github.com/getoutreach/gobox/pkg/app.Version=$VERSION" -v ./cmd/...
mkdir -p bin; \
go build -o /src/bin/ -ldflags "-X github.com/getoutreach/gobox/pkg/app.Version=$VERSION" -v ./cmd/...

FROM gcr.io/outreach-docker/alpine:3.1
ENTRYPOINT ["/usr/local/bin/testing"]
Expand Down
8 changes: 4 additions & 4 deletions templates/deployments/appname/Dockerfile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $goVersion := semver (stencil.ApplyTemplate "goVersion" | trim) }}
{{- $_ := file.SetPath (printf "deployments/%s/%s" .Config.Name (base file.Path)) }}
{{- $_ := stencil.ApplyTemplate "skipIfNotService" }}
FROM gcr.io/outreach-docker/golang:{{ $goVersion.Major }}.{{ $goVersion.Minor }}.{{ $goVersion.Patch }} as builder
FROM {{ .Runtime.Box.Docker.ImagePullRegistry }}/golang:{{ $goVersion.Major }}.{{ $goVersion.Minor }}.{{ $goVersion.Patch }} as builder
ARG VERSION
ENV GOCACHE "/go-build-cache"
ENV GOPRIVATE github.com/{{ .Runtime.Box.Org }}/*
Expand All @@ -22,10 +22,10 @@ RUN --mount=type=ssh --mount=type=cache,target=/go/pkg go mod download
# Build our application, caching the go build cache, but also using
# the dependency cache from earlier.
RUN --mount=type=ssh --mount=type=cache,target=/go/pkg --mount=type=cache,target=/go-build-cache \
mkdir -p bin; \
go build -o /src/bin/ -ldflags "-X github.com/getoutreach/gobox/pkg/app.Version=$VERSION" -v ./cmd/...
mkdir -p bin; \
go build -o /src/bin/ -ldflags "-X github.com/getoutreach/gobox/pkg/app.Version=$VERSION" -v ./cmd/...

FROM gcr.io/outreach-docker/alpine:{{ stencil.Arg "versions.alpine" }}
FROM {{ .Runtime.Box.Docker.ImagePullRegistry }}/alpine:{{ stencil.Arg "versions.alpine" }}
ENTRYPOINT ["/usr/local/bin/{{ .Config.Name }}"]

LABEL "io.outreach.reporting_team"="{{ stencil.Arg "reportingTeam" }}"
Expand Down
8 changes: 4 additions & 4 deletions templates/devspace.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ vars:
default: devenv.local
DEVENV_DEPLOY_BOX_IMAGE_REGISTRY:
source: env
default: gcr.io/outreach-docker
default: {{ .Runtime.Box.Docker.ImagePullRegistry }}
DEVENV_DEPLOY_IMAGE_REGISTRY:
source: env
default: ${DEVENV_DEPLOY_BOX_IMAGE_REGISTRY}
Expand Down Expand Up @@ -89,7 +89,7 @@ vars:
source: env
default: 42097
DEV_CONTAINER_WORKDIR: /home/dev/app
DEV_CONTAINER_IMAGE: gcr.io/outreach-docker/bootstrap/dev:stable
DEV_CONTAINER_IMAGE: {{ .Runtime.Box.Docker.ImagePullRegistry }}/bootstrap/dev:stable
DEV_CONTAINER_LOGFILE: /tmp/app.log
DEV_CONTAINER_CACHE: /home/dev/.cache

Expand All @@ -116,7 +116,7 @@ dev:
cpu: 5
memory: 10Gi

# Specifies the dev container to use. In this case gcr.io/outreach-docker/bootstrap/dev:stable
# Specifies the dev container to use. In this case {{ .Runtime.Box.Docker.ImagePullRegistry }}/bootstrap/dev:stable
devImage: ${DEV_CONTAINER_IMAGE}

# `dev.app.ports` specifies all ports that should be forwarded while `devspace dev` is running
Expand Down Expand Up @@ -450,7 +450,7 @@ profiles:
patches:
- op: replace
path: vars.DEV_CONTAINER_IMAGE
value: gcr.io/outreach-docker/bootstrap/dev-slim:stable
value: {{ .Runtime.Box.Docker.ImagePullRegistry }}/bootstrap/dev-slim:stable
- op: replace
path: dev.app.sync[0]
value:
Expand Down

0 comments on commit 0ab77ef

Please sign in to comment.