remove unused target on Makefile.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
bd51a03cc1
commit
4b0be4eb5c
|
@ -24,7 +24,7 @@ pipeline:
|
||||||
chmod +x .codecov &&
|
chmod +x .codecov &&
|
||||||
./.codecov -t ${CODECOV_TOKEN} -f .cover/coverage.txt
|
./.codecov -t ${CODECOV_TOKEN} -f .cover/coverage.txt
|
||||||
# build binary for docker image
|
# build binary for docker image
|
||||||
- make docker_binary_build
|
- make docker_build
|
||||||
|
|
||||||
release:
|
release:
|
||||||
image: appleboy/golang-testing:${GO_VERSION}
|
image: appleboy/golang-testing:${GO_VERSION}
|
||||||
|
|
|
@ -30,6 +30,7 @@ script:
|
||||||
- make vet
|
- make vet
|
||||||
- make lint
|
- make lint
|
||||||
- make test
|
- make test
|
||||||
|
- make build
|
||||||
|
|
||||||
# after_success:
|
# after_success:
|
||||||
# - bash <(curl -s https://codecov.io/bash) -f .cover/coverage.txt
|
# - bash <(curl -s https://codecov.io/bash) -f .cover/coverage.txt
|
||||||
|
|
31
Makefile
31
Makefile
|
@ -1,4 +1,4 @@
|
||||||
.PHONY: all test build fmt vet errcheck lint install update release-dirs release-build release-copy release-check release
|
.PHONY: all gorush test build fmt vet errcheck lint install update release-dirs release-build release-copy release-check release
|
||||||
|
|
||||||
export PROJECT_PATH = /go/src/github.com/appleboy/gorush
|
export PROJECT_PATH = /go/src/github.com/appleboy/gorush
|
||||||
|
|
||||||
|
@ -118,43 +118,28 @@ release-check:
|
||||||
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
|
cd $(DIST)/release; $(foreach file,$(wildcard $(DIST)/release/$(EXECUTABLE)-*),sha256sum $(notdir $(file)) > $(notdir $(file)).sha256;)
|
||||||
|
|
||||||
|
|
||||||
docker_binary_build:
|
docker_build:
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o bin/$@
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags '$(TAGS)' -ldflags "$(EXTLDFLAGS)-s -w $(LDFLAGS)" -o bin/$(EXECUTABLE)
|
||||||
|
|
||||||
docker_image:
|
docker_image:
|
||||||
docker build -t $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE) -f Dockerfile .
|
docker build -t $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE) -f Dockerfile .
|
||||||
|
|
||||||
docker_release: docker_binary_build docker_image
|
docker_release: docker_build docker_image
|
||||||
|
|
||||||
docker_build:
|
|
||||||
tar -zcvf build.tar.gz gorush.go gorush config storage Makefile glide.lock glide.yaml
|
|
||||||
sed -e "s/#VERSION#/$(VERSION)/g" docker/Dockerfile.build > docker/Dockerfile.tmp
|
|
||||||
docker build -t $(BUILD_IMAGE) -f docker/Dockerfile.tmp .
|
|
||||||
docker run --rm $(BUILD_IMAGE) > gorush.tar.gz
|
|
||||||
|
|
||||||
docker_production:
|
|
||||||
docker build -t $(EXECUTABLE) -f docker/Dockerfile.dist .
|
|
||||||
|
|
||||||
docker_deploy:
|
docker_deploy:
|
||||||
ifeq ($(tag),)
|
ifeq ($(tag),)
|
||||||
@echo "Usage: make $@ tag=<tag>"
|
@echo "Usage: make $@ tag=<tag>"
|
||||||
@exit 1
|
@exit 1
|
||||||
endif
|
endif
|
||||||
docker tag $(EXECUTABLE):latest $(DEPLOY_ACCOUNT)/$(EXECUTABLE):$(tag)
|
docker tag $(DEPLOY_ACCOUNT)/$(EXECUTABLE):latest $(DEPLOY_ACCOUNT)/$(EXECUTABLE):$(tag)
|
||||||
docker push $(DEPLOY_ACCOUNT)/$(EXECUTABLE):$(tag)
|
docker push $(DEPLOY_ACCOUNT)/$(EXECUTABLE):$(tag)
|
||||||
|
|
||||||
docker_test: init clean
|
|
||||||
docker-compose -p ${EXECUTABLE} -f docker/docker-compose.testing.yml run gorush
|
|
||||||
docker-compose -p ${EXECUTABLE} -f docker/docker-compose.testing.yml down
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
go clean -x -i ./...
|
go clean -x -i ./...
|
||||||
find . -name coverage.txt -delete
|
find . -name coverage.txt -delete
|
||||||
-rm -rf build.tar.gz \
|
find . -name *.tar.gz -delete
|
||||||
gorush.tar.gz bin/* \
|
find . -name *.db -delete
|
||||||
gorush.tar.gz \
|
-rm -rf bin/* \
|
||||||
gorush/gorush.db \
|
|
||||||
storage/boltdb/gorush.db \
|
|
||||||
.cover
|
.cover
|
||||||
|
|
||||||
version:
|
version:
|
||||||
|
|
Loading…
Reference in New Issue