Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Remove Dockerfile from build
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 Dec 15, 2020
1 parent daf63ff commit 6be018b
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
with:
fetch-depth: 1
- name: Make all
run: make all
run: make ci
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
fetch-depth: 1
- name: Make all
run: make all
run: make ci
- name: Upload release binaries
uses: alexellis/[email protected]
env:
Expand Down
44 changes: 0 additions & 44 deletions Dockerfile

This file was deleted.

54 changes: 0 additions & 54 deletions Dockerfile.redist

This file was deleted.

50 changes: 29 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
Version := $(shell git describe --tags --dirty)
GitCommit := $(shell git rev-parse HEAD)
LDFLAGS := "-s -w -X github.com/openfaas/ofc-bootstrap/cmd.Version=$(Version) -X github.com/openfaas/ofc-bootstrap/cmd.GitCommit=$(GitCommit)"
SOURCE_DIRS = cmd pkg main.go
export GO111MODULE=on

GO_FILES?=$(shell find . -name '*.go' |grep -v vendor)
TAG?=latest
GIT_COMMIT=$(shell git rev-list -1 HEAD)
VERSION=$(shell git describe --all --exact-match `git rev-parse HEAD` | grep tags | sed 's/tags\///')
.PHONY: all
all: gofmt test dist hash

.PHONY: build install-ci ci static dist
.PHONY: ci
ci: all install-ci ci

.PHONY: build
build:
./build.sh
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o ofc-bootstrap

install-ci:
./hack/install-ci.sh
ci:
./hack/integration-test.sh
.PHONY: gofmt
gofmt:
@test -z $(shell gofmt -l -s $(SOURCE_DIRS) ./ | tee /dev/stderr) || (echo "[WARN] Fix formatting issues with 'make fmt'" && exit 1)

static:
go test $(shell go list ./... | grep -v /vendor/ | grep -v /template/|grep -v /build/) -cover \
&& CGO_ENABLED=0 go build --ldflags "-s -w \
-X github.com/openfaas/ofc-bootstrap/version.GitCommit=${GIT_COMMIT} \
-X github.com/openfaas/ofc-bootstrap/version.Version=${VERSION}" \
-a -installsuffix cgo -o ofc-bootstrap
.PHONY: test
test:
CGO_ENABLED=0 go test $(shell go list ./... | grep -v /vendor/|xargs echo) -cover

.PHONY: dist
dist:
./build_redist.sh

fmt:
go fmt ./...
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/ofc-bootstrap
CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/ofc-bootstrap-darwin
CGO_ENABLED=0 GOOS=windows go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/ofc-bootstrap.exe

.PHONY: hash
hash:
rm -rf bin/*.sha256 && ./hack/hashgen.sh

all: fmt build install-ci ci dist hash
.PHONY: install-ci
install-ci:
./hack/install-ci.sh

.PHONY: ci
ci:
./hack/integration-test.sh
17 changes: 0 additions & 17 deletions build.sh

This file was deleted.

22 changes: 0 additions & 22 deletions build_redist.sh

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/apply.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) OpenFaaS Author(s) 2019. All rights reserved.
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package cmd
Expand Down
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) OpenFaaS Author(s) 2019. All rights reserved.
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package cmd
Expand Down Expand Up @@ -55,7 +55,8 @@ func parseBaseCommand(_ *cobra.Command, _ []string) {

fmt.Printf(
`ofc-bootstrap
Bootstrap your own OpenFaaS Cloud within 100 seconds
Bootstrap your own self-hosted OpenFaaS Cloud
Commit: %s
Version: %s
Expand Down
2 changes: 1 addition & 1 deletion get.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright OpenFaaS Author(s) 2019
# Copyright OpenFaaS Author(s) 2020
#########################
# Repo specific content #
#########################
Expand Down
2 changes: 2 additions & 0 deletions hack/install-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ curl -sLSf https://dl.get-arkade.dev | sudo sh

arkade get kind
sudo mv $HOME/.arkade/bin/kind /usr/local/bin/

./bin/ofc-bootstrap version
2 changes: 1 addition & 1 deletion pkg/types/merge.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) OpenFaaS Author(s) 2019. All rights reserved.
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package types
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/merge_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) OpenFaaS Author(s) 2019. All rights reserved.
// Copyright (c) OpenFaaS Author(s) 2020. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package types
Expand Down

0 comments on commit 6be018b

Please sign in to comment.