X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=cmd%2Fbpa-restapi-agent%2FMakefile;h=6b4194773ebc4732dc5ee76b4524762b78a9b2a4;hb=refs%2Fchanges%2F53%2F1753%2F21;hp=ba40a6ff6d53f65b4f5f6ef0413b09e05f144dad;hpb=d405dd38324cda90cbf1849b3c52a62cd4c878ac;p=icn.git diff --git a/cmd/bpa-restapi-agent/Makefile b/cmd/bpa-restapi-agent/Makefile index ba40a6f..6b41947 100644 --- a/cmd/bpa-restapi-agent/Makefile +++ b/cmd/bpa-restapi-agent/Makefile @@ -1,24 +1,22 @@ +.PHONY: build -# The name of the executable (default is current directory name) -TARGET := $(shell echo $${PWD\#\#*/}) -.DEFAULT_GOAL: $(TARGET) +build: untar + go build -mod=vendor -o build/_output/bin/bpa-restapi-agent main.go -# These will be provided to the target -VERSION := 1.0.0 -BUILD := `git rev-parse HEAD` +docker: + docker build -t akraino.org/icn/bpa-restapi-agent:latest . -f build/Dockerfile -# Use linker flags to provide version/build settings to the target -LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)" +untar: + tar -xzvf vendor.tar.gz -# go source files, ignore vendor directory -SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*") +deploy: docker + ./bpa_api_install.sh -.PHONY: all build +test: go_install + go test ./... -v -all: build +go_install: + install_go.sh -$(TARGET): $(SRC) - @go build $(LDFLAGS) -o $(TARGET) - -build: $(TARGET) - @true +e2e_test: deploy + ./e2e_test.sh