X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=cmd%2Fbpa-restapi-agent%2FMakefile;h=6437dc3b5278c55bd639339fef0ab46497c46afe;hb=c9f32d1ce3a511ec6f1176527065fd964c5fe12c;hp=ba40a6ff6d53f65b4f5f6ef0413b09e05f144dad;hpb=5885be79556efc50b6ee9e1c6e51a803095b9073;p=icn.git diff --git a/cmd/bpa-restapi-agent/Makefile b/cmd/bpa-restapi-agent/Makefile index ba40a6f..6437dc3 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: + go build -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)" +deploy: docker + ./bpa_api_install.sh -# go source files, ignore vendor directory -SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*") +unit_test: go_install + go test ./internal/app -.PHONY: all build +go_install: + ./install_go.sh -all: build +e2e_test: deploy + ./e2e_test.sh -$(TARGET): $(SRC) - @go build $(LDFLAGS) -o $(TARGET) - -build: $(TARGET) - @true +clean: + ./bpa_api_uninstall.sh