forked from nimbolus/terraform-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Goals: - Faster docker image build - Images for all pushes - Upload CLI binaries to releases
- Loading branch information
Showing
6 changed files
with
127 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
builds: | ||
- id: tf-preview-gh | ||
main: ./cmd/tf-preview-gh | ||
binary: tf-preview-gh | ||
|
||
env: | ||
- CGO_ENABLED=0 | ||
|
||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
|
||
archives: | ||
- id: tf-preview-gh | ||
builds: | ||
- tf-preview-gh | ||
format: binary | ||
name_template: >- | ||
{{ .Binary }}_{{ .Os }}- | ||
{{- if eq .Arch "arm64" -}} | ||
{{- if eq .Os "linux" -}} | ||
aarch64 | ||
{{- else -}} | ||
{{ .Arch }} | ||
{{- end -}} | ||
{{- else if eq .Arch "amd64" -}} | ||
x86_64 | ||
{{- else -}} | ||
{{ .Arch }} | ||
{{- end }} | ||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
release: | ||
prerelease: auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# build binary | ||
FROM golang:1.22 AS builder | ||
FROM --platform=$BUILDPLATFORM ghcr.io/crazy-max/xgo:latest AS builder | ||
|
||
COPY . /go/src/github.com/nimbolus/terraform-backend | ||
COPY . /source | ||
WORKDIR /source | ||
|
||
WORKDIR /go/src/github.com/nimbolus/terraform-backend | ||
|
||
RUN GOOS=linux CGO_ENABLED=1 go build ./cmd/terraform-backend | ||
ARG TARGETPLATFORM | ||
ENV TARGETS=$TARGETPLATFORM | ||
ENV PACK=cmd/terraform-backend | ||
ENV OUT=terraform-backend | ||
ENV GO111MODULE=on | ||
RUN xgo-build . | ||
|
||
# start clean for final image | ||
FROM debian:12 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get -q update && \ | ||
apt-get -yq install ca-certificates && \ | ||
apt-get autoclean | ||
|
||
COPY --from=builder /go/src/github.com/nimbolus/terraform-backend/terraform-backend /terraform-backend | ||
ARG TARGETPLATFORM | ||
COPY --from=builder /build/terraform-backend-${TARGETPLATFORM/\//-} /terraform-backend | ||
|
||
ENTRYPOINT ["/terraform-backend"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters