Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
build: move Version const to root package
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Oct 8, 2019
1 parent 40040a2 commit 8204a45
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import (

"github.com/moov-io/base/admin"
"github.com/moov-io/base/http/bind"
"github.com/moov-io/paygate"
"github.com/moov-io/paygate/internal"
"github.com/moov-io/paygate/internal/database"
"github.com/moov-io/paygate/internal/fed"
"github.com/moov-io/paygate/internal/filetransfer"
"github.com/moov-io/paygate/internal/microdeposit"
"github.com/moov-io/paygate/internal/ofac"
"github.com/moov-io/paygate/internal/util"
"github.com/moov-io/paygate/internal/version"
"github.com/moov-io/paygate/pkg/achclient"

"github.com/go-kit/kit/log"
Expand Down Expand Up @@ -55,7 +55,7 @@ func main() {
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
logger = log.With(logger, "caller", log.DefaultCaller)

logger.Log("startup", fmt.Sprintf("Starting paygate server version %s", version.Version))
logger.Log("startup", fmt.Sprintf("Starting paygate server version %s", paygate.Version))

// migrate database
db, err := database.New(logger, os.Getenv("DATABASE_TYPE"))
Expand All @@ -81,7 +81,7 @@ func main() {
*adminAddr = v
}
adminServer := admin.NewServer(*adminAddr)
adminServer.AddVersionHandler(version.Version) // Setup 'GET /version'
adminServer.AddVersionHandler(paygate.Version) // Setup 'GET /version'
go func() {
logger.Log("admin", fmt.Sprintf("listening on %s", adminServer.BindAddr()))
if err := adminServer.Listen(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PLATFORM=$(shell uname -s | tr '[:upper:]' '[:lower:]')
VERSION := $(shell grep -Eo '(v[0-9]+[\.][0-9]+[\.][0-9]+(-[a-zA-Z0-9]*)?)' internal/version/version.go)
VERSION := $(shell grep -Eo '(v[0-9]+[\.][0-9]+[\.][0-9]+(-[a-zA-Z0-9]*)?)' version.go)

.PHONY: build docker release

Expand Down
4 changes: 2 additions & 2 deletions pkg/achclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"time"

"github.com/moov-io/base/http/bind"
"github.com/moov-io/paygate/internal/version"
"github.com/moov-io/paygate"

"github.com/go-kit/kit/log"
)
Expand Down Expand Up @@ -115,7 +115,7 @@ func createRequestId() string {
}

func (a *ACH) addRequestHeaders(idempotencyKey, requestID string, r *http.Request) {
r.Header.Set("User-Agent", fmt.Sprintf("ach/%s", version.Version))
r.Header.Set("User-Agent", fmt.Sprintf("ach/%s", paygate.Version))
if idempotencyKey != "" {
r.Header.Set("X-Idempotency-Key", idempotencyKey)
}
Expand Down
5 changes: 3 additions & 2 deletions internal/version/version.go → version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.

package version
package paygate

const Version = "v0.7.0-rc1"
// Version number
const Version = "v0.7.0-rc2"

0 comments on commit 8204a45

Please sign in to comment.