-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (35 loc) · 1.39 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
46
47
PLUGIN_NAME=fargate
ifndef _ARCH
_ARCH := $(shell ./print_arch)
export _ARCH
endif
.PHONY: all
all: protos build zip
# Generate the Go code from Protocol Buffer definitions
protos:
@echo ""
@echo "Build Protos"
# protoc -I . --go_out=plugins=grpc:. --go_opt=paths=source_relative ./platform/output.proto
# Builds the plugin on your local machine
build:
@echo ""
@echo "Compile Plugin"
# Clear the output
rm -rf ./bin
GOOS=linux GOARCH=amd64 go build -o ./bin/linux_amd64/waypoint-plugin-${PLUGIN_NAME} ./main.go
GOOS=darwin GOARCH=amd64 go build -o ./bin/darwin_amd64/waypoint-plugin-${PLUGIN_NAME} ./main.go
GOOS=windows GOARCH=amd64 go build -o ./bin/windows_amd64/waypoint-plugin-${PLUGIN_NAME}.exe ./main.go
# Install the plugin locally
install:
@echo ""
@echo "Installing Plugin"
cp ./bin/${_ARCH}_amd64/waypoint-plugin-${PLUGIN_NAME}* ${HOME}/.config/waypoint/plugins/
# Zip the built plugin binaries
zip:
zip -j ./bin/waypoint-plugin-${PLUGIN_NAME}_linux_amd64.zip ./bin/linux_amd64/waypoint-plugin-${PLUGIN_NAME}
zip -j ./bin/waypoint-plugin-${PLUGIN_NAME}_darwin_amd64.zip ./bin/darwin_amd64/waypoint-plugin-${PLUGIN_NAME}
zip -j ./bin/waypoint-plugin-${PLUGIN_NAME}_windows_amd64.zip ./bin/windows_amd64/waypoint-plugin-${PLUGIN_NAME}.exe
# Build the plugin using a Docker container
build-docker:
rm -rf ./releases
DOCKER_BUILDKIT=1 docker build --output releases --progress=plain .