Skip to content

Commit

Permalink
Merge branch 'ivo/print_version'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Schinnerl committed Jun 8, 2022
2 parents 45bd733 + 442fdda commit 62d7ae4
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# These variables get inserted into ./build/commit.go
BUILD_TIME=$(shell date)
BUILD_TIME=$(shell date -u)
GIT_REVISION=$(shell git rev-parse --short HEAD)
GIT_DIRTY=$(shell git diff-index --quiet HEAD -- || echo "✗-")

ldflags= -X github.com/SkynetLabs/skynet-accounts/build.GitRevision=${GIT_DIRTY}${GIT_REVISION} \
ldflags= -X "github.com/SkynetLabs/skynet-accounts/build.GitRevision=${GIT_DIRTY}${GIT_REVISION}" \
-X "github.com/SkynetLabs/skynet-accounts/build.BuildTime=${BUILD_TIME}"

racevars= history_size=3 halt_on_error=1 atexit_sleep_ms=2000
Expand Down
9 changes: 9 additions & 0 deletions build/build.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package build

// GitRevision and BuildTime get assigned via the Makefile when built.
var (
// GitRevision is the git commit hash used when built
GitRevision string
// BuildTime is the date and time the build was completed
BuildTime string
)
6 changes: 6 additions & 0 deletions build/debug_off.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build !debug

package build

// DEBUG set to false turns the debugging off
const DEBUG = false
6 changes: 6 additions & 0 deletions build/debug_on.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build debug

package build

// DEBUG set to true turns the debugging on
const DEBUG = true
6 changes: 6 additions & 0 deletions build/release_dev.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build dev

package build

// Release refers to the dev release mode.
const Release = "dev"
6 changes: 6 additions & 0 deletions build/release_standard.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build !testing,!dev

package build

// Release refers to the standard release mode.
const Release = "standard"
6 changes: 6 additions & 0 deletions build/release_testing.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// +build testing

package build

// Release refers to the testing release mode.
const Release = "testing"
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"strings"

"github.com/SkynetLabs/skynet-accounts/api"
"github.com/SkynetLabs/skynet-accounts/build"
"github.com/SkynetLabs/skynet-accounts/database"
"github.com/SkynetLabs/skynet-accounts/email"
"github.com/SkynetLabs/skynet-accounts/jwt"
"github.com/SkynetLabs/skynet-accounts/metafetcher"
"github.com/joho/godotenv"
"github.com/stripe/stripe-go/v72"
"gitlab.com/SkynetLabs/skyd/build"
"gitlab.com/SkynetLabs/skyd/skymodules"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -264,5 +264,6 @@ func main() {
if err != nil {
log.Fatal(errors.AddContext(err, "failed to build the API"))
}
log.Printf("Starting Accounts.\nGitRevision: %v (built %v)\n", build.GitRevision, build.BuildTime)
logger.Fatal(server.ListenAndServe(3000))
}

0 comments on commit 62d7ae4

Please sign in to comment.