forked from cvbarros/terraform-provider-teamcity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (31 loc) · 2.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export GO111MODULE=on
GIT_COMMIT=$(shell git rev-parse HEAD)
GIT_DIRTY=$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true)
BUILD_DATE=$(shell date '+%Y-%m-%d-%H:%M:%S')
BUILDER_IMAGE=64mb/terraform-provider-teamcity-builder
VERSION=0.0.1
default: test
build:
GO111MODULE=on go build -o ./bin/terraform-provider-teamcity_v${VERSION} . && chmod +x ./bin/terraform-provider-teamcity_v${VERSION}
build-linux-amd64:
mkdir -p ./bin/linux_amd64 && GOOS=linux GO111MODULE=on go build -o ./bin/linux_amd64/terraform-provider-teamcity_v${VERSION} . && chmod +x ./bin/linux_amd64/terraform-provider-teamcity_v${VERSION}
build-darwin-amd64:
mkdir -p ./bin/darwin_amd64 && GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -o ./bin/darwin_amd64/terraform-provider-teamcity_v${VERSION} . && chmod +x ./bin/darwin_amd64/terraform-provider-teamcity_v${VERSION}
build-darwin-arm64:
mkdir -p ./bin/darwin_arm64 && GOOS=darwin GOARCH=arm64 GO111MODULE=on go build -o ./bin/darwin_arm64/terraform-provider-teamcity_v${VERSION} . && chmod +x ./bin/darwin_arm64/terraform-provider-teamcity_v${VERSION}
build-windows-amd64:
mkdir -p ./bin/windows_amd64 && GOOS=windows GOARCH=arm64 GO111MODULE=on go build -o ./bin/windows_amd64/terraform-provider-teamcity_v${VERSION} . && chmod +x ./bin/windows_amd64/terraform-provider-teamcity_v${VERSION}
build-all: build-linux-amd64 build-darwin-amd64 build-darwin-arm64 build-windows-amd64
install: build
mkdir -p ~/.terraform.d/plugins/terraform.local/64mb/teamcity/${VERSION}/linux_amd64 && cp ./bin/terraform-provider-teamcity_v${VERSION} ~/.terraform.d/plugins/terraform.local/64mb/teamcity/${VERSION}/linux_amd64
clean:
rm -rf ./bin
builder-action:
docker run -e GITHUB_WORKSPACE='/github/workspace' -e GITHUB_REPOSITORY='terraform-provider-teamcity' -e GITHUB_REF='v0.0.1-alpha' --name terraform-provider-teamcity-builder $(BUILDER_IMAGE):latest
builder-image:
docker build .github/builder --tag $(BUILDER_IMAGE)
clean_samples:
find ./examples -name '*.tfstate' -delete
find ./examples -name ".terraform" -type d -exec rm -rf "{}" \;
fmt_samples:
terraform fmt -recursive examples/