Skip to content

Commit

Permalink
Merge pull request #38 from vdice/chore/go-mod
Browse files Browse the repository at this point in the history
chore(*): update to use Go modules
  • Loading branch information
vdice authored Jan 21, 2020
2 parents 6ac46d8 + 87ef52b commit 81a7040
Show file tree
Hide file tree
Showing 807 changed files with 591 additions and 301,805 deletions.
436 changes: 0 additions & 436 deletions Gopkg.lock

This file was deleted.

36 changes: 0 additions & 36 deletions Gopkg.toml

This file was deleted.

24 changes: 10 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ MIXIN = arm
PKG = get.porter.sh/mixin/$(MIXIN)
SHELL = bash

GO = GO111MODULE=on go

PORTER_HOME ?= $(HOME)/.porter

COMMIT ?= $(shell git rev-parse --short HEAD)
VERSION ?= $(shell git describe --tags 2> /dev/null || echo v0)
PERMALINK ?= $(shell git describe --tags --exact-match &> /dev/null && echo latest || echo canary)

LDFLAGS = -w -X $(PKG)/pkg.Version=$(VERSION) -X $(PKG)/pkg.Commit=$(COMMIT)
XBUILD = CGO_ENABLED=0 go build -a -tags netgo -ldflags '$(LDFLAGS)'
XBUILD = CGO_ENABLED=0 $(GO) build -a -tags netgo -ldflags '$(LDFLAGS)'
BINDIR = bin/mixins/$(MIXIN)

CLIENT_PLATFORM ?= $(shell go env GOOS)
Expand All @@ -34,19 +36,19 @@ build: build-client build-runtime

build-runtime: generate
mkdir -p $(BINDIR)
GOARCH=$(RUNTIME_ARCH) GOOS=$(RUNTIME_PLATFORM) go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(MIXIN)-runtime$(FILE_EXT) ./cmd/$(MIXIN)
GOARCH=$(RUNTIME_ARCH) GOOS=$(RUNTIME_PLATFORM) $(GO) build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(MIXIN)-runtime$(FILE_EXT) ./cmd/$(MIXIN)

build-client: generate
mkdir -p $(BINDIR)
go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(MIXIN)$(FILE_EXT) ./cmd/$(MIXIN)
$(GO) build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(MIXIN)$(FILE_EXT) ./cmd/$(MIXIN)

generate: packr2
go generate ./...
$(GO) generate ./...

HAS_PACKR2 := $(shell command -v packr2)
packr2:
ifndef HAS_PACKR2
go get -u github.com/gobuffalo/packr/v2/packr2
$(GO) get -u github.com/gobuffalo/packr/v2/packr2
endif

xbuild-all:
Expand All @@ -60,22 +62,16 @@ $(BINDIR)/$(VERSION)/$(MIXIN)-$(CLIENT_PLATFORM)-$(CLIENT_ARCH)$(FILE_EXT):
mkdir -p $(dir $@)
GOOS=$(CLIENT_PLATFORM) GOARCH=$(CLIENT_ARCH) $(XBUILD) -o $@ ./cmd/$(MIXIN)

test: test-unit test-templates
test: test-unit
$(BINDIR)/$(MIXIN)$(FILE_EXT) version

test-unit: build
go test ./...

test-templates: jsonpp
@for template in $$(ls pkg/arm/arm/templates); do \
echo "ensuring valid json: $$template" ; \
cat pkg/arm/arm/templates/$$template | json_pp > /dev/null ; \
done
$(GO) test ./...

HAS_JSONPP := $(shell command -v jsonpp)
jsonpp:
ifndef HAS_JSONPP
go get -u github.com/jmhodges/jsonpp
$(GO) get -u github.com/jmhodges/jsonpp
endif

publish: bin/porter$(FILE_EXT)
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pool:

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go1.11' # Go installation path
GOROOT: '/usr/local/go1.13' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/get.porter.sh/mixin/arm' # Path to the module's cod

Expand Down
25 changes: 25 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module get.porter.sh/mixin/arm

go 1.13

require (
get.porter.sh/porter v0.22.1-beta.1
github.com/Azure/azure-sdk-for-go v38.2.0+incompatible
github.com/Azure/go-autorest v12.2.0+incompatible
github.com/Azure/go-autorest/autorest v0.9.0
github.com/Azure/go-autorest/autorest/adal v0.5.0
github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/gobuffalo/packr/v2 v2.7.1
github.com/huandu/xstrings v1.3.0 // indirect
github.com/kelseyhightower/envconfig v1.4.0
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.4.0
gopkg.in/yaml.v2 v2.2.4
)

replace github.com/hashicorp/go-plugin => github.com/carolynvs/go-plugin v1.0.1-acceptstdin
553 changes: 553 additions & 0 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/arm/templates/arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (d *deployer) Delete(
err,
)
}
if err := result.WaitForCompletion(
if err := result.WaitForCompletionRef(
ctx,
d.deploymentsClient.Client,
); err != nil {
Expand Down Expand Up @@ -386,7 +386,7 @@ func (d *deployer) doDeployment(
return nil, fmt.Errorf("error submitting ARM template: %s", err)
}

if err = result.WaitForCompletion(
if err = result.WaitForCompletionRef(
ctx,
d.deploymentsClient.Client,
); err != nil {
Expand Down
21 changes: 0 additions & 21 deletions vendor/get.porter.sh/porter/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion vendor/get.porter.sh/porter/docs/themes/porter/assets

This file was deleted.

152 changes: 0 additions & 152 deletions vendor/get.porter.sh/porter/pkg/context/context.go

This file was deleted.

1 change: 0 additions & 1 deletion vendor/get.porter.sh/porter/pkg/context/doc.go

This file was deleted.

Loading

0 comments on commit 81a7040

Please sign in to comment.