Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ jobs:
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
build-args: |
VERSION=${{ github.ref_name }}
2 changes: 2 additions & 0 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ jobs:
tags: |
ghcr.io/${{ github.repository }}:dev
ghcr.io/${{ github.repository }}:dev-${{ github.sha }}
build-args: |
VERSION=dev-${{ github.sha }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ COPY static/ ./static/
COPY templates/ ./templates/
COPY *.go ./

RUN CGO_ENABLED=0 GOOS=linux go build -o curier .
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.version=${VERSION}" -o curier .

FROM scratch

Expand Down
3 changes: 3 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ var templateFiles embed.FS

var shareTemplate *template.Template

// Will be updated by ldflags
var version = "dev"

// All variables can be overwritten by using environment variables.
// All env vars need to start with `CURIER_` followed by the variable name in uppercase, each word separated with an underscore.
//
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

func main() {

log.Printf("Starting curier %s\n", version)

parseEnvVars()
parseFS()

Expand Down
Loading