-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from betr-io/update-dependencies
Maintenance
- Loading branch information
Showing
18 changed files
with
597 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ trim_trailing_whitespace = true | |
indent_size = 4 | ||
|
||
[Makefile] | ||
indent_size = 8 | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,83 @@ | ||
SHELL := /bin/bash | ||
|
||
OPERATING_SYSTEM=Linux | ||
TEST?=$$(go list ./... | grep -v 'vendor') | ||
HOSTNAME=betr.io | ||
NAMESPACE=betr | ||
NAME=mssql | ||
BINARY=terraform-provider-${NAME} | ||
VERSION=0.2.7 | ||
OS_ARCH=linux_amd64 | ||
TERRAFORM=terraform | ||
VERSION = 0.3.0 | ||
|
||
TERRAFORM = terraform | ||
TERRAFORM_VERSION = "~> 1.5" | ||
|
||
GO = go | ||
MODULE = $(shell env GO111MODULE=on $(GO) list -m) | ||
PKGS = $(shell env GO111MODULE=on $(GO) list ./... | grep -v /vendor/) | ||
TESTPKGS = $(shell env GO111MODULE=on $(GO) list -f \ | ||
'{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' \ | ||
$(PKGS)) | ||
|
||
ifeq ($(OS),Windows_NT) | ||
OPERATING_SYSTEM=Windows | ||
ifeq ($(PROCESSOR_ARCHITEW6432),AMD64) | ||
OS_ARCH=windows_amd64 | ||
else | ||
ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) | ||
OS_ARCH=windows_amd64 | ||
endif | ||
ifeq ($(PROCESSOR_ARCHITECTURE),x86) | ||
OS_ARCH=windows_386 | ||
endif | ||
endif | ||
else | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Linux) | ||
OPERATING_SYSTEM=Linux | ||
_OS=linux | ||
endif | ||
ifeq ($(UNAME_S),Darwin) | ||
OPERATING_SYSTEM=MacOS | ||
_OS=darwin | ||
endif | ||
UNAME_P := $(shell uname -p) | ||
ifeq ($(UNAME_P),x86_64) | ||
OS_ARCH=$(_OS)_amd64 | ||
endif | ||
ifneq ($(filter %86,$(UNAME_P)),) | ||
OS_ARCH=$(_OS)_386 | ||
endif | ||
ifneq ($(filter arm%,$(UNAME_P)),) | ||
OS_ARCH=$(_OS)_arm | ||
endif | ||
endif | ||
|
||
INSTALL_PATH=~/.terraform.d/plugins/$(shell basename $(shell dirname $(MODULE)))/$(shell basename $(MODULE) | cut -d'-' -f3)/${VERSION}/${OS_ARCH} | ||
|
||
default: install | ||
|
||
build: | ||
go build -o ${BINARY} | ||
CGO_ENABLED=0 $(GO) build -o $(shell basename $(MODULE)) | ||
|
||
release: | ||
# Runs goreleaser locally (testrun) | ||
goreleaser release --rm-dist --skip-sign --skip-publish | ||
|
||
install: build | ||
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
mkdir -p $(INSTALL_PATH) | ||
mv $(shell basename $(MODULE)) $(INSTALL_PATH)/ | ||
|
||
test: | ||
go test -i $(TEST) || exit 1 | ||
echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 | ||
echo $(TESTPKGS) | xargs -t -n4 $(GO) test $(TESTARGS) -timeout=30s -parallel=4 | ||
|
||
testacc: | ||
if [ -f .local.env ]; then source .local.env; fi && TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | ||
if [ -f .local.env ]; then source .local.env; fi && TF_ACC=1 TERRAFORM_VERSION=$(TERRAFORM_VERSION) $(GO) test $(TESTPKGS) -v $(TESTARGS) -timeout 120m | ||
|
||
testacc-local: | ||
if [ -f .local.env ]; then source .local.env; fi && TF_ACC_LOCAL=1 go test $(TEST) -v $(TESTARGS) -timeout 120m | ||
if [ -f .local.env ]; then source .local.env; fi && TF_ACC_LOCAL=1 TERRAFORM_VERSION=$(TERRAFORM_VERSION) $(GO) test $(TESTPKGS) -v $(TESTARGS) -timeout 120m | ||
|
||
docker-start: | ||
cd test-fixtures/local && ${TERRAFORM} init && ${TERRAFORM} apply -auto-approve -var="operating_system=${OPERATING_SYSTEM}" | ||
cd test-fixtures/local && export TERRAFORM_VERSION=$(TERRAFORM_VERSION) && ${TERRAFORM} init && ${TERRAFORM} apply -auto-approve -var="operating_system=${OPERATING_SYSTEM}" | ||
|
||
docker-stop: | ||
cd test-fixtures/local && ${TERRAFORM} destroy -auto-approve -var="operating_system=${OPERATING_SYSTEM}" | ||
cd test-fixtures/local && TERRAFORM_VERSION=$(TERRAFORM_VERSION) ${TERRAFORM} destroy -auto-approve -var="operating_system=${OPERATING_SYSTEM}" | ||
|
||
azure-create: | ||
cd test-fixtures/all && ${TERRAFORM} init && ${TERRAFORM} apply -auto-approve -var="operating_system=${OPERATING_SYSTEM}" | ||
cd test-fixtures/all && export TERRAFORM_VERSION=$(TERRAFORM_VERSION) && ${TERRAFORM} init && ${TERRAFORM} apply -auto-approve | ||
|
||
azure-destroy: | ||
cd test-fixtures/all && ${TERRAFORM} destroy -auto-approve -var="operating_system=${OPERATING_SYSTEM}" | ||
cd test-fixtures/all && TERRAFORM_VERSION=$(TERRAFORM_VERSION) ${TERRAFORM} destroy -auto-approve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.