Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Set static version
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrizic committed Apr 30, 2024
1 parent 5d5aa07 commit c0e3c0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.22.1-alpine3.19 as build

WORKDIR /app
COPY . /app
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build --ldflags '-extldflags=-static' -o delete-from-enterprise main.go
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-extldflags=-static -X github.com/prodyna/delete-from-enterprise/meta.Version=1.0.0" -o delete-from-enterprise main.go

FROM alpine:3.19.1
COPY --from=build /app/delete-from-enterprise /app/
Expand Down
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package main

import "fmt"
import (
"fmt"
"github.com/prodyna/delete-from-enterprise/meta"
)

func main() {
fmt.Printf("Hello, World!\n")
fmt.Printf("Hello, World! %s\n", meta.Version)
}
3 changes: 3 additions & 0 deletions meta/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package meta

var Version = "undefined"

0 comments on commit c0e3c0f

Please sign in to comment.