Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,22 @@ jobs:
GIT_COMMIT=${{ github.sha }}
REPO_URL=https://github.com/openfaas/faas-cli
tags: openfaas/faas-cli:${{ github.sha }}
-
-
name: Test the redistributable binaries cross-compile
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile.redist
push: false
load: false
platforms: linux/amd64
target: release
build-args: |
VERSION=latest-dev
GIT_COMMIT=${{ github.sha }}
REPO_URL=https://github.com/openfaas/faas-cli
tags: openfaas/faas-cli-redist:${{ github.sha }}
-
name: Copy binary to host
run: |
docker create --name faas-cli openfaas/faas-cli:${{ github.sha }} && \
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build
faas-cli
faas-cli-darwin
faas-cli-darwin-arm64
faas-cli-armhf
faas-cli.exe
faas-cli-arm64

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To build the release binaries type in:
./extract_binaries.sh
```

This creates the faas-cli for Mac, Windows, Linux x64, Linux ARMHF and Linux ARM64.
This creates the faas-cli for Mac, Windows, Linux x64 and Linux ARM64.

* The project manages dependencies using Go modules and the `vendor/` folder. When updating a dependency you must run

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

Check warning on line 1 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 1 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

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

Check warning on line 4 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 4 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
Expand Down Expand Up @@ -26,14 +26,14 @@
RUN /usr/bin/license-check -path ./ --verbose=false "Alex Ellis" "OpenFaaS Author(s)" "OpenFaaS Ltd" \
&& go test $(go list ./... | grep -v /vendor/ | grep -v /template/|grep -v /build/) -cover

FROM builder as linux

Check warning on line 29 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 29 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
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" \
-o faas-cli

FROM builder as darwin

Check warning on line 36 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 36 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
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} \
Expand All @@ -41,28 +41,21 @@
-o faas-cli-darwin


FROM builder as darwin-arm64

Check warning on line 44 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 44 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
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" \
-o faas-cli-darwin-arm64

FROM builder as windows

Check warning on line 51 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 51 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
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" \
-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" \
-o faas-cli-armhf

FROM builder as arm64

Check warning on line 58 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 58 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
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} \
Expand All @@ -70,7 +63,7 @@
-o faas-cli-arm64

# Release stage
FROM alpine:3.21.0 as release

Check warning on line 66 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 66 in Dockerfile.redist

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

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

Expand All @@ -83,7 +76,6 @@
COPY --from=linux /go/src/github.com/openfaas/faas-cli/faas-cli .
COPY --from=darwin /go/src/github.com/openfaas/faas-cli/faas-cli-darwin .
COPY --from=darwin-arm64 /go/src/github.com/openfaas/faas-cli/faas-cli-darwin-arm64 .
COPY --from=arm /go/src/github.com/openfaas/faas-cli/faas-cli-armhf .
COPY --from=windows /go/src/github.com/openfaas/faas-cli/faas-cli.exe .
COPY --from=arm64 /go/src/github.com/openfaas/faas-cli/faas-cli-arm64 .

Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ dist:
test-unit:
go test $(shell go list ./... | grep -v /vendor/ | grep -v /template/ | grep -v build) -cover

.PHONY: ci-armhf-push
ci-armhf-push:
(docker push openfaas/faas-cli:$(TAG)-armhf && docker push openfaas/faas-cli:$(TAG)-root-armhf)

.PHONY: ci-armhf-build
ci-armhf-build:
(./build.sh $(TAG)-armhf)

.PHONY: ci-arm64-push
ci-arm64-push:
(docker push openfaas/faas-cli:$(TAG)-arm64 && docker push openfaas/faas-cli:$(TAG)-root-arm64)
Expand Down
7 changes: 0 additions & 7 deletions build_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ get_package() {
;;
esac
;;
"Linux")
case $arch in
"armv6l" | "armv7l")
cli="./faas-cli-armhf"
;;
esac
;;
esac

echo "Using package $cli"
Expand Down
2 changes: 1 addition & 1 deletion commands/local_run_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func negativeMemoryError(value string) error {

func oversizedMemoryError(value string) error {
// Typed as int64 so the constant does not take its default type of int,
// which overflows when cross-compiling for a 32-bit target such as armhf.
// which would overflow when building for a 32-bit target.
return fmt.Errorf("invalid memory value %q: must be under %d bytes", value, int64(math.MaxInt64))
}

Expand Down
1 change: 0 additions & 1 deletion extract_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ docker create --name faas-cli openfaas/faas-cli:${eTAG} && \
docker cp faas-cli:/home/app/faas-cli ./bin && \
docker cp faas-cli:/home/app/faas-cli-darwin ./bin && \
docker cp faas-cli:/home/app/faas-cli-darwin-arm64 ./bin && \
docker cp faas-cli:/home/app/faas-cli-armhf ./bin && \
docker cp faas-cli:/home/app/faas-cli-arm64 ./bin && \
docker cp faas-cli:/home/app/faas-cli.exe ./bin && \
docker rm -f faas-cli
4 changes: 0 additions & 4 deletions npm/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ module.exports = {
if (arch === 'aarch64') {
return '-arm64';
}

if (arch === 'armv61' || arch === 'armv71') {
return '-armhf'
}
}

if (type === 'Darwin') {
Expand Down
10 changes: 3 additions & 7 deletions npm/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ describe('Platform Suffix', function () {
let result = lib.getSuffix('Linux', 'aarch64');
assert.equal(result, '-arm64', `Expected '-arm64', but got: ${result}`);
});
it('should return -armhf for Linux armv61', function () {
let result = lib.getSuffix('Linux', 'armv61');
assert.equal(result, '-armhf', `Expected '-armhf', but got: ${result}`);
});
it('should return -armhf for Linux armv71', function () {
let result = lib.getSuffix('Linux', 'armv71');
assert.equal(result, '-armhf', `Expected '-armhf', but got: ${result}`);
it('should throw for 32-bit Arm, which is no longer published', function () {
assert.throws(() => {lib.getSuffix('Linux', 'armv61')});
assert.throws(() => {lib.getSuffix('Linux', 'armv71')});
});
it('should return -darwin for MacOS', function () {
let result = lib.getSuffix('Darwin', '');
Expand Down
Loading