Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version info when running 'make install' #577

Merged
merged 2 commits into from
May 30, 2018
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
14 changes: 1 addition & 13 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
name = "github.com/golang/protobuf"
version = "1.1.0"

[[constraint]]
name = "github.com/google/go-github"
version = "15.0.0"

[[constraint]]
name = "github.com/grpc-ecosystem/go-grpc-middleware"
version = "1.0.0"
Expand Down
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
ifndef GOPATH
$(error GOPATH is not set)
endif

TESTS=$(shell go list ./... | grep -v /vendor/ | grep -v github-release-notes)

export SHELL=/bin/bash
PATH := ${PATH}:${GOPATH}/bin
export PATH

PROTO_INC=-I ./ -I $(shell pwd)/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis

git_commit := $(shell git rev-parse --short HEAD)
git_branch := $(shell git symbolic-ref -q --short HEAD)
git_upstream := $(shell git remote get-url $(shell git config branch.$(shell git symbolic-ref -q --short HEAD).remote) 2> /dev/null)
export GIT_BRANCH = $(git_branch)
Expand All @@ -21,10 +14,16 @@ export FUNNEL_VERSION=0.7.0
# based on pull requests (PR) up until the last release.
export LAST_PR_NUMBER = 521

VERSION_LDFLAGS=\
-X "github.com/ohsu-comp-bio/funnel/version.BuildDate=$(shell date)" \
-X "github.com/ohsu-comp-bio/funnel/version.GitCommit= $(git_commit)" \
-X "github.com/ohsu-comp-bio/funnel/version.GitBranch=$(git_branch)" \
-X "github.com/ohsu-comp-bio/funnel/version.GitUpstream=$(git_upstream)"

# Build the code
install: depends
@touch version/version.go
@go install github.com/ohsu-comp-bio/funnel
@go install -ldflags '$(VERSION_LDFLAGS)' github.com/ohsu-comp-bio/funnel

# Generate the protobuf/gRPC code
proto:
Expand Down Expand Up @@ -208,7 +207,7 @@ bundle-examples:
@gofmt -w -s examples/internal/bundle.go config/internal/bundle.go

# Make everything usually needed to prepare for a pull request
full: proto install prune_deps add_deps tidy lint test website webdash
full: proto install tidy lint test website webdash

# Build the website
website:
Expand Down