Skip to content

Commit

Permalink
Update to Go 1.20 and upgrade internal dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Jun 6, 2023
1 parent 41da629 commit 2b40a5a
Show file tree
Hide file tree
Showing 19 changed files with 313 additions and 304 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/openfaas/license-check:0.4.1 as license-check

# Build stage
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19 as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.20 as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand Down Expand Up @@ -37,10 +37,10 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=${TARGETARCH}" \
-a -installsuffix cgo -o faas-cli
-o faas-cli

# CICD stage
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.17.2 as root
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.18 as root

ARG REPO_URL

Expand Down
16 changes: 8 additions & 8 deletions Dockerfile.redist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/openfaas/license-check:0.4.1 as license-check

# Build stage
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19 as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.20 as builder

ARG GIT_COMMIT
ARG VERSION
Expand Down Expand Up @@ -31,46 +31,46 @@ RUN CGO_ENABLED=0 GOOS=linux go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=x86_64" \
-a -installsuffix cgo -o faas-cli
-o faas-cli

FROM builder as darwin
RUN CGO_ENABLED=0 GOOS=darwin go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=x86_64" \
-a -installsuffix cgo -o faas-cli-darwin
-o faas-cli-darwin


FROM builder as darwin-arm64
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=arm64" \
-a -installsuffix cgo -o faas-cli-darwin-arm64
-o faas-cli-darwin-arm64

FROM builder as windows
RUN CGO_ENABLED=0 GOOS=windows go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=x86_64" \
-a -installsuffix cgo -o faas-cli.exe
-o faas-cli.exe

FROM builder as arm
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=armhf" \
-a -installsuffix cgo -o faas-cli-armhf
-o faas-cli-armhf

FROM builder as arm64
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${VERSION} \
-X github.com/openfaas/faas-cli/commands.Platform=arm64" \
-a -installsuffix cgo -o faas-cli-arm64
-o faas-cli-arm64

# Release stage
FROM alpine:3.17.2
FROM alpine:3.18 as release

RUN apk --no-cache add ca-certificates git

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,30 @@ local-install:
CGO_ENABLED=0 go install --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${.GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${.GIT_VERSION}" \
-a -installsuffix cgo


.PHONY: dist
dist:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${.GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${.GIT_VERSION}" \
-a -installsuffix cgo -o ./bin/faas-cli
-o ./bin/faas-cli

CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${.GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${.GIT_VERSION}" \
-a -installsuffix cgo -o ./bin/faas-cli-darwin
-o ./bin/faas-cli-darwin

CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${.GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${.GIT_VERSION}" \
-a -installsuffix cgo -o ./bin/faas-cli-darwin-arm64
-o ./bin/faas-cli-darwin-arm64


CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build --ldflags "-s -w \
-X github.com/openfaas/faas-cli/version.GitCommit=${.GIT_COMMIT} \
-X github.com/openfaas/faas-cli/version.Version=${.GIT_VERSION}" \
-a -installsuffix cgo -o ./bin/faas-cli.exe
-o ./bin/faas-cli.exe


.PHONY: test-unit
Expand Down
17 changes: 3 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ module github.com/openfaas/faas-cli

go 1.19

// replace github.com/docker/docker => github.com/docker/engine v1.4.2-0.20190717161051-705d9623b7c1

// replace golang.org/x/sys => golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6

require (
github.com/alexellis/arkade v0.0.0-20230605091329-f497d2e645f6
github.com/alexellis/go-execute v0.5.0
github.com/alexellis/hmac v1.3.0
github.com/docker/docker v23.0.5+incompatible
github.com/drone/envsubst v1.0.3
github.com/google/go-cmp v0.5.9
github.com/mitchellh/go-homedir v1.1.0
Expand All @@ -28,19 +23,18 @@ require (
github.com/alexellis/hmac/v2 v2.0.0
github.com/google/go-containerregistry v0.15.2
github.com/mitchellh/go-wordwrap v1.0.1
github.com/moby/term v0.0.0-20221205130635-1aeaba878587
github.com/moby/term v0.5.0
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/cheggaaa/pb/v3 v3.1.2 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/docker/cli v23.0.5+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v24.0.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.16.5 // indirect
Expand All @@ -51,15 +45,10 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/otiai10/copy v1.11.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sethvargo/go-password v0.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 2b40a5a

Please sign in to comment.