Skip to content

Commit

Permalink
remove build information
Browse files Browse the repository at this point in the history
  • Loading branch information
vigo committed Dec 24, 2024
1 parent 5b5b3f3 commit 476a4fa
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ replace = "version-{new_version}-orange.svg"
filename = "release/release.go"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
filename = "release/release.go"
search = "var BuildInformation = \"[a-f0-9]{{1,12}}\""
replace = "var BuildInformation = \"{commit_sha}\""
regex = true
5 changes: 0 additions & 5 deletions .github/workflows/push-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set short-sha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -27,7 +23,6 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
build-args: "BUILD_INFORMATION= - ${{ steps.vars.outputs.sha_short }}"
platforms: linux/amd64,linux/arm64
push: true
provenance: false
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/push-to-github-cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set short-sha
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -28,7 +24,6 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
build-args: "BUILD_INFORMATION= - ${{ steps.vars.outputs.sha_short }}"
platforms: linux/amd64,linux/arm64
push: true
provenance: false
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ COPY . .

ARG GOOS
ARG GOARCH
ARG BUILD_INFORMATION
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -ldflags="-X 'github.com/vbyazilim/basichttpdebugger/release.BuildInformation=${BUILD_INFORMATION}'" -o server .
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o server .

FROM alpine:latest AS certs
RUN apk add --update --no-cache ca-certificates
Expand Down
3 changes: 0 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ namespace :docker do
desc "build docker image locally"
task :build do
system %{
BUILD_INFORMATION=" - $(git rev-parse --short HEAD)"
GOOS="linux"
GOARCH=$(go env GOARCH)
docker build \
--build-arg="BUILD_INFORMATION=${BUILD_INFORMATION}" \
--build-arg="GOOS=${GOOS}" \
--build-arg="GOARCH=${GOARCH}" \
-t #{DOCKER_IMAGE_NAME} .
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func debugHandlerFunc(cn *accept.ContentNegotiation, fwriter *os.File, hmsv stri
w.WriteHeader(http.StatusOK)
fmt.Fprintln(w, "OK")

mainTitle := "Basic HTTP Debugger - v" + release.Version + release.BuildInformation
mainTitle := "Basic HTTP Debugger - v" + release.Version + " - " + release.BuildInformation

fmt.Fprintln(fwriter, strings.Repeat("-", terminalWidth))
t := table.NewWriter()
Expand Down
4 changes: 2 additions & 2 deletions release/release.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package release

// Version is the current version of service.
const Version string = "0.2.2"
const Version = "0.2.2"

// BuildInformation holds current build information.
var BuildInformation string
var BuildInformation = "000"

0 comments on commit 476a4fa

Please sign in to comment.