diff --git a/.build.yml b/.build.yml index 1e22572..698ed39 100644 --- a/.build.yml +++ b/.build.yml @@ -11,7 +11,6 @@ sources: tasks: - test: | cd ntfy-alertmanager - go generate ./... go test -v ./... - lint: | cd ntfy-alertmanager diff --git a/.gitignore b/.gitignore index 2b0be1e..6948ee2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /ntfy-alertmanager -version.txt diff --git a/docker/Dockerfile-dev b/docker/Dockerfile-dev index fe5031e..5c340b2 100644 --- a/docker/Dockerfile-dev +++ b/docker/Dockerfile-dev @@ -3,7 +3,7 @@ WORKDIR /app COPY . . RUN apk add --no-cache git -RUN go generate ./... && go build -o /app/ntfy-alertmanager +RUN go build -ldflags="-X main.version=$(git describe --long)" -o /app/ntfy-alertmanager FROM alpine:latest diff --git a/main.go b/main.go index cd0500c..6958636 100644 --- a/main.go +++ b/main.go @@ -19,9 +19,7 @@ import ( "golang.org/x/text/language" ) -//go:generate sh -c "git describe --long > version.txt" -//go:embed version.txt -var version string +var version = "dev" type receiver struct { cfg *config