2015-04-30 20:40:06 -05:00
|
|
|
GIT_COMMIT = $(shell git rev-parse HEAD)
|
2015-05-05 00:34:23 -05:00
|
|
|
BUILD_TIME = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ" | tr -d '\n')
|
2019-11-29 13:59:50 -06:00
|
|
|
GO_VERSION = $(shell go version | awk {'print $$3'})
|
2015-03-16 23:59:46 -05:00
|
|
|
DOCKER_RELEASE_TAG = "sosedoff/pgweb:$(shell git describe --abbrev=0 --tags | sed 's/v//')"
|
2016-06-27 20:54:29 -05:00
|
|
|
DOCKER_LATEST_TAG = "sosedoff/pgweb:latest"
|
2021-12-30 15:33:43 -06:00
|
|
|
LDFLAGS = -s -w
|
|
|
|
PKG = github.com/sosedoff/pgweb
|
2014-10-31 05:02:58 +00:00
|
|
|
|
2014-12-26 20:50:15 -06:00
|
|
|
usage:
|
|
|
|
@echo ""
|
|
|
|
@echo "Task : Description"
|
|
|
|
@echo "----------------- : -------------------"
|
|
|
|
@echo "make dev : Generate development build"
|
|
|
|
@echo "make build : Generate production build for current OS"
|
|
|
|
@echo "make release : Generate binaries for all supported OSes"
|
2015-04-30 12:10:25 -05:00
|
|
|
@echo "make test : Execute test suite"
|
2016-01-17 15:22:51 -06:00
|
|
|
@echo "make test-all : Execute test suite on multiple PG versions"
|
2014-12-26 20:50:15 -06:00
|
|
|
@echo "make clean : Remove all build files and reset assets"
|
2014-12-31 18:47:21 -06:00
|
|
|
@echo "make docker : Build docker image"
|
2015-03-17 00:01:28 -05:00
|
|
|
@echo "make docker-release : Build and tag docker image"
|
2016-06-27 20:54:29 -05:00
|
|
|
@echo "make docker-push : Push docker images to registry"
|
2014-12-26 20:50:15 -06:00
|
|
|
@echo ""
|
|
|
|
|
2014-12-17 21:39:03 -06:00
|
|
|
test:
|
2021-03-05 03:38:08 +03:00
|
|
|
go test -race -cover ./pkg/...
|
2014-12-17 21:39:03 -06:00
|
|
|
|
2016-01-17 15:22:51 -06:00
|
|
|
test-all:
|
|
|
|
@./script/test_all.sh
|
2018-06-05 18:20:58 -05:00
|
|
|
@./script/test_cockroach.sh
|
2016-01-17 15:22:51 -06:00
|
|
|
|
2022-11-14 16:10:50 -06:00
|
|
|
lint:
|
|
|
|
golangci-lint run
|
|
|
|
|
2021-03-05 03:38:08 +03:00
|
|
|
dev:
|
|
|
|
go build
|
2014-12-13 20:43:07 -06:00
|
|
|
@echo "You can now execute ./pgweb"
|
|
|
|
|
2021-03-05 03:38:08 +03:00
|
|
|
build:
|
|
|
|
go build
|
2014-12-13 20:43:07 -06:00
|
|
|
@echo "You can now execute ./pgweb"
|
|
|
|
|
2022-09-18 10:14:51 -05:00
|
|
|
install:
|
|
|
|
go install
|
|
|
|
@echo "You can now execute pgweb"
|
|
|
|
|
2021-12-30 15:33:43 -06:00
|
|
|
release: LDFLAGS += -X $(PKG)/pkg/command.GitCommit=$(GIT_COMMIT)
|
|
|
|
release: LDFLAGS += -X $(PKG)/pkg/command.BuildTime=$(BUILD_TIME)
|
|
|
|
release: LDFLAGS += -X $(PKG)/pkg/command.GoVersion=$(GO_VERSION)
|
2022-07-26 20:17:40 -05:00
|
|
|
release: clean
|
2015-05-06 21:24:15 -05:00
|
|
|
@echo "Building binaries..."
|
2022-07-26 20:17:40 -05:00
|
|
|
@LDFLAGS='${LDFLAGS}' ./script/build_all.sh
|
2014-10-10 17:32:47 -05:00
|
|
|
|
|
|
|
clean:
|
2022-07-26 20:17:40 -05:00
|
|
|
@echo "Removing all artifacts"
|
|
|
|
@rm -rf ./pgweb ./bin/*
|
2014-11-05 18:27:14 -06:00
|
|
|
|
|
|
|
docker:
|
2019-12-16 17:26:23 -06:00
|
|
|
docker build --no-cache -t pgweb .
|
2015-03-16 23:59:46 -05:00
|
|
|
|
|
|
|
docker-release:
|
2019-07-24 17:28:15 -05:00
|
|
|
docker build --no-cache -t $(DOCKER_RELEASE_TAG) .
|
|
|
|
docker tag $(DOCKER_RELEASE_TAG) $(DOCKER_LATEST_TAG)
|
2019-07-31 16:43:17 +02:00
|
|
|
docker images $(DOCKER_RELEASE_TAG)
|
2016-06-27 20:54:29 -05:00
|
|
|
|
|
|
|
docker-push:
|
|
|
|
docker push $(DOCKER_RELEASE_TAG)
|
2021-12-30 15:33:43 -06:00
|
|
|
docker push $(DOCKER_LATEST_TAG)
|