这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.DS_Store

# Eclipse
.classpath
.project
Expand Down
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROTOBUFS = $(shell find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort
TARGET_PACKAGES = $(shell find . -name 'main.go' -print0 | xargs -0 -n1 dirname | sort --unique | grep -v /vendor/)

ifeq ($(VERSION),)
VERSION = $(shell cat ./Versionfile)
VERSION = latest
endif
LDFLAGS = -ldflags "-X \"github.com/mosuka/blast/version.Version=$(VERSION)\""

Expand Down Expand Up @@ -115,21 +115,32 @@ dist:
@for target_pkg in $(TARGET_PACKAGES); do echo $$target_pkg; $(GO) build -tags="$(BUILD_TAGS)" $(LDFLAGS) -o ./dist/$(GOOS)-$(GOARCH)/bin/`basename $$target_pkg`$(BIN_EXT) $$target_pkg || exit 1; done
(cd ./dist/$(GOOS)-$(GOARCH); tar zcfv ../blast-${VERSION}.$(GOOS)-$(GOARCH).tar.gz .)

.PHONY: git-tag
git-tag:
@echo ">> tagging github"
@echo " VERSION = $(VERSION)"
ifeq ($(VERSION),$(filter $(VERSION),latest master ""))
@echo "please specify VERSION"
else
git tag -a $(VERSION) -m "Release $(VERSION)"
git push origin $(VERSION)
endif

.PHONY: docker-build
docker-build:
@echo ">> building docker container image"
@echo " DOCKER_REPOSITORY = $(DOCKER_REPOSITORY)"
@echo " VERSION = $(VERSION)"
docker build -t $(DOCKER_REPOSITORY)/blast:latest --build-arg VERSION=$(VERSION) .
docker tag mosuka/blast:latest $(DOCKER_REPOSITORY)/blast:v$(VERSION)
docker tag $(DOCKER_REPOSITORY)/blast:latest $(DOCKER_REPOSITORY)/blast:$(VERSION)

.PHONY: docker-push
docker-push:
@echo ">> pushing docker container image"
@echo " DOCKER_REPOSITORY = $(DOCKER_REPOSITORY)"
@echo " VERSION = $(VERSION)"
docker push $(DOCKER_REPOSITORY)/blast:latest
docker push $(DOCKER_REPOSITORY)/blast:v$(VERSION)
docker push $(DOCKER_REPOSITORY)/blast:$(VERSION)

.PHONY: clean
clean:
Expand Down
1 change: 0 additions & 1 deletion Versionfile

This file was deleted.