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
3 changes: 2 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ steps:
- name: build
image: golang:1.13
commands:
- ./hack/build.sh
- GO111MODULE=off go get github.com/mitchellh/gox
- make build
environment:
BUILD_ARCHS: "linux/amd64 linux/arm64 linux/arm darwin/amd64 windows/amd64"
when:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/cluster.yml
/cloudinit.yml
output/
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
.PHONY: test
.PHONY: test clean
test:
CGO_ENABLED=0 go test $(shell go list ./... | grep -v /vendor/|xargs echo) -cover
CGO_ENABLED=0 go test $(shell go list ./... | grep -v /vendor/|xargs echo) -cover


BUILD_ARCHS ?= $(shell go env GOOS)/$(shell go env GOARCH)
# User drone tag as the build verion if given in env
VERSION ?= $(or ${DRONE_TAG},latest)

build:
mkdir -p output
CGO_ENABLED=0 gox -output="output/trieres_{{.OS}}_{{.Arch}}" \
-osarch="${BUILD_ARCHS}" \
-ldflags "-s -w -X main.Version=${VERSION}" \
github.com/jakolehm/trieres/

clean:
rm -rf output/*
19 changes: 0 additions & 19 deletions hack/build.sh

This file was deleted.

8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import (
"github.com/urfave/cli/v2"
)

// VERSION gets overridden at build time using -X main.VERSION=$VERSION
var VERSION = "dev"
// Version gets overridden at build time using -X main.Version=$VERSION
var (
Version = "dev"
)

func init() {
logrus.SetOutput(os.Stdout)
Expand All @@ -20,7 +22,7 @@ func init() {
func main() {
app := &cli.App{
Name: "trieres",
Version: VERSION,
Version: Version,
Usage: "k3s cluster lifecycle management tool",
Commands: []*cli.Command{
cmd.UpCommand(),
Expand Down