cleanup and add travis

pull/2/head
iwilltry42 6 years ago
parent a1cdcc26c7
commit 8758d5b48d
  1. 23
      .travis.yml
  2. 13
      Makefile
  3. 4
      main.go

@ -0,0 +1,23 @@
dist: xenial
language: go
env:
- GO111MODULE=on
go:
- 1.12.x
- master
git:
depth: 1
install: true
before_script:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
- go install github.com/mitchellh/gox
script:
- golangci-lint run
- make fmt check build-cross

@ -15,12 +15,14 @@ GOFLAGS :=
BINDIR := $(CURDIR)/bin
BINARIES := k3d
export GO111MODULE=on
# go source files, ignore vendor directory
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
.PHONY: all build build-cross clean install uninstall fmt simplify check run bootstrap
.PHONY: all build build-cross clean fmt simplify check bootstrap
all: check install
all: check build
build:
$(GO) build -i $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINARIES)'
@ -44,14 +46,9 @@ check:
@go vet ${SRC}
# Check for required executables
HAS_GOX := $(shell command -v gox;)
HAS_GIT := $(shell command -v git;)
HAS_GOX := $(shell command -v gox 2> /dev/null)
bootstrap:
ifndef HAS_GOX
go get -u github.com/mitchellh/gox
endif
ifndef HAS_GIT
$(error You must install Git)
endif

@ -28,9 +28,7 @@ func createCluster(c *cli.Context) error {
extraArgs = append(extraArgs, "--volume", c.String("volume"))
}
if len(extraArgs) > 0 {
for _, extra := range extraArgs {
args = append(args, extra)
}
args = append(args, extraArgs...)
}
args = append(args,
"-d",

Loading…
Cancel
Save