diff --git a/Dockerfile b/Dockerfile index 893a3e8..4b06ae9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ FROM golang:1.18-alpine as builder WORKDIR /build COPY . . RUN apk add make + +ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 RUN make build # IMAGE: CONTAINER diff --git a/Makefile b/Makefile index ba52239..a371c85 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,6 @@ docker-build: # TODO: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#labelling-container-images docker tag vbr:latest ghcr.io/nathan13888/vbr:latest - docker push ghcr.io/nathan13888/vbr:latest docker-run: docker run -it --rm -p 80:8080 -p 443:8081 -p 9090:9090 vbr @@ -29,9 +28,10 @@ publish: make publish-ghcr publish-ghcr: - docker tag ghcr.io/nathan13888/vbr:latest ghcr.io/nathan13888/vbr:1.1 + docker push ghcr.io/nathan13888/vbr:latest + docker tag ghcr.io/nathan13888/vbr:latest ghcr.io/nathan13888/vbr:1.2 # TODO: use latest git tag as tag ^^ - docker push ghcr.io/nathan13888/vbr:1.1 + docker push ghcr.io/nathan13888/vbr:1.2 clean: diff --git a/build.go b/build.go new file mode 100644 index 0000000..c0601a3 --- /dev/null +++ b/build.go @@ -0,0 +1,5 @@ +package main + +var ( + BuildTime string +) diff --git a/deployments/README.md b/deployments/README.md deleted file mode 100644 index 773cb4a..0000000 --- a/deployments/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# `/deployments` ---- -This folder contains all the necessary deployment files for a HA Kubernetes cluster. - -## Assumptions -- **Traefik 2** as the ingress controller -- The secrets files are customized to your deployment configs -- `prod-external` as the namespace - -## Usage -> In the future, this will become a Helm chart... - -- Apply everything using `kubectl -f ` - - diff --git a/server.go b/server.go index 05f7dae..79bd775 100644 --- a/server.go +++ b/server.go @@ -229,6 +229,7 @@ func getStatus(w http.ResponseWriter, r *http.Request) { Uptime: int64(time.Since(startTime).Seconds()), CodeRepository: "https://github.com/Nathan13888/VisitorBadgeReloaded", RedisStatus: "TBI", + Version: BuildVersion, // TODO: more redis fields }