Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
* Remove `release` target. This will be properly implemented once we
  release the first version of the provider.
* Use `go env` to dynamically determine the binary `OS` and `ARCH`.
* Use `0.1.0` version.
  • Loading branch information
Ionut Balutoiu committed May 4, 2021
1 parent 96f61fc commit ff25bf5
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ HOSTNAME=registry.terraform.io
NAMESPACE=ionutbalutoiu
NAME=maas
BINARY=terraform-provider-${NAME}
VERSION=0.1
OS_ARCH=darwin_arm64
VERSION=0.1.0
OS?=$$(go env GOOS)
ARCH?=$$(go env GOARCH)

default: install

Expand All @@ -13,27 +14,10 @@ build:
mkdir -p ./bin
go build -o ./bin/${BINARY}

.PHONY: release
release:
mkdir -p ./dist
GOOS=darwin GOARCH=amd64 go build -o ./dist/${BINARY}_${VERSION}_darwin_amd64
GOOS=darwin GOARCH=arm64 go build -o ./dist/${BINARY}_${VERSION}_darwin_arm64
GOOS=freebsd GOARCH=386 go build -o ./dist/${BINARY}_${VERSION}_freebsd_386
GOOS=freebsd GOARCH=amd64 go build -o ./dist/${BINARY}_${VERSION}_freebsd_amd64
GOOS=freebsd GOARCH=arm go build -o ./dist/${BINARY}_${VERSION}_freebsd_arm
GOOS=linux GOARCH=386 go build -o ./dist/${BINARY}_${VERSION}_linux_386
GOOS=linux GOARCH=amd64 go build -o ./dist/${BINARY}_${VERSION}_linux_amd64
GOOS=linux GOARCH=arm go build -o ./dist/${BINARY}_${VERSION}_linux_arm
GOOS=openbsd GOARCH=386 go build -o ./dist/${BINARY}_${VERSION}_openbsd_386
GOOS=openbsd GOARCH=amd64 go build -o ./dist/${BINARY}_${VERSION}_openbsd_amd64
GOOS=solaris GOARCH=amd64 go build -o ./dist/${BINARY}_${VERSION}_solaris_amd64
GOOS=windows GOARCH=386 go build -o ./dist/${BINARY}_${VERSION}_windows_386
GOOS=windows GOARCH=amd64 go build -o ./dist/${BINARY}_${VERSION}_windows_amd64

.PHONY: install
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ./bin/${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS}_${ARCH}
mv ./bin/${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS}_${ARCH}

.PHONY: test
test:
Expand Down

0 comments on commit ff25bf5

Please sign in to comment.