mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-22 22:28:51 +01:00
revert main.ReleaseVersion changes
This commit is contained in:
parent
0d30011a33
commit
a8360efa67
@ -6,7 +6,7 @@ RUN go mod download
|
||||
COPY . ./
|
||||
ARG GOARCH
|
||||
RUN apk add --update --no-cache --virtual .build-deps build-base && \
|
||||
GOARCH=${GOARCH} go build -o /server -ldflags "-X release.Version=v0.`cat VERSION`" backend/server/server.go && \
|
||||
GOARCH=${GOARCH} go build -o /server -ldflags "-X main.ReleaseVersion=v0.`cat VERSION`" backend/server/server.go && \
|
||||
apk del .build-deps
|
||||
|
||||
FROM alpine:3.17
|
||||
|
@ -3,8 +3,6 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/ddworken/hishtory/internal/release"
|
||||
"github.com/ddworken/hishtory/internal/server"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
@ -12,6 +10,8 @@ import (
|
||||
|
||||
"github.com/DataDog/datadog-go/statsd"
|
||||
"github.com/ddworken/hishtory/internal/database"
|
||||
"github.com/ddworken/hishtory/internal/release"
|
||||
"github.com/ddworken/hishtory/internal/server"
|
||||
_ "github.com/lib/pq"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
@ -23,8 +23,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
GLOBAL_DB *database.DB
|
||||
GLOBAL_STATSD *statsd.Client
|
||||
GLOBAL_DB *database.DB
|
||||
GLOBAL_STATSD *statsd.Client
|
||||
ReleaseVersion string
|
||||
)
|
||||
|
||||
func isTestEnvironment() bool {
|
||||
@ -96,6 +97,7 @@ func OpenDB() (*database.DB, error) {
|
||||
}
|
||||
|
||||
func init() {
|
||||
release.Version = ReleaseVersion
|
||||
if release.Version == "UNKNOWN" && !isTestEnvironment() {
|
||||
panic("server.go was built without a ReleaseVersion!")
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ func buildServer() string {
|
||||
f, err := os.CreateTemp("", "server")
|
||||
checkError(err)
|
||||
fn := f.Name()
|
||||
cmd := exec.Command("go", "build", "-o", fn, "-ldflags", fmt.Sprintf("-X release.Version=v0.%s", version), "backend/server/server.go")
|
||||
cmd := exec.Command("go", "build", "-o", fn, "-ldflags", fmt.Sprintf("-X main.ReleaseVersion=v0.%s", version), "backend/server/server.go")
|
||||
var stdout bytes.Buffer
|
||||
cmd.Stdout = &stdout
|
||||
var stderr bytes.Buffer
|
||||
|
Loading…
Reference in New Issue
Block a user