-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
21 lines (15 loc) · 971 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
override DOCKER = $(shell which docker)
override GIT_VERSION = $(shell git rev-parse --abbrev-ref HEAD)${CUSTOM} $(shell git rev-parse HEAD)
override PROJECT_NAME = sqle-oracle-plugin
override LDFLAGS = -ldflags "-X 'main.version=\"${GIT_VERSION}\"'"
override GOBIN = ${shell pwd}/bin
GO_COMPILER_IMAGE ?= golang:1.16
# Copy from SQLE
PROJECT_VERSION = $(shell if [ "$$(git tag --points-at HEAD | tail -n1)" ]; then git tag --points-at HEAD | tail -n1 | sed 's/v\(.*\)/\1/'; else git rev-parse --abbrev-ref HEAD | sed 's/release-\(.*\)/\1/' | tr '-' '\n' | head -n1; fi)
default: install
install:
go build -mod=vendor ${LDFLAGS} -o $(GOBIN)/$(PROJECT_NAME) ./
docker_install:
$(DOCKER) run -v $(shell pwd):/universe --rm $(GO_COMPILER_IMAGE) sh -c "cd /universe && make install $(MAKEFLAGS)"
upload:
curl -T $(GOBIN)/$(PROJECT_NAME) ftp://$(RELEASE_FTPD_HOST)/actiontech-sqle/plugins/$(PROJECT_VERSION)/$(PROJECT_NAME) --ftp-create-dirs