Skip to content

Commit

Permalink
Upgrade Go version from 1.21 to 1.22 (#280)
Browse files Browse the repository at this point in the history
* Upgrade Go version from 1.21 to 1.22

* Add command to print docker-compose logs

* Rebuild dev Dockerfile

* Add printing just exporter logs if failed

* Add actual healthcheck to Dockerfile dev
  • Loading branch information
kuskoman committed Feb 15, 2024
1 parent 709979d commit a1247fd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/go-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Lint code using golangci-lint
uses: golangci/golangci-lint-action@v4
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Test code
run: go test ./... -covermode=atomic -coverprofile=coverage.out
Expand Down Expand Up @@ -156,6 +156,14 @@ jobs:
- name: Wait for compose
run: make wait-for-compose

- name: Print compose logs if failed
run: docker-compose logs
if: failure()

- name: Print exporter logs if failed
run: docker-compose logs exporter
if: failure()

- name: Run metrics integration test
run: make verify-metrics

Expand All @@ -179,7 +187,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Build Linux binary
run: make build-linux
Expand All @@ -204,7 +212,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Build Linux ARM binary
run: make build-linux-arm
Expand All @@ -229,7 +237,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Build Mac binary
run: make build-darwin
Expand All @@ -254,7 +262,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.21"
go-version: "^1.22"

- name: Build Windows binary
run: make build-windows
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.5-alpine3.17 as build
FROM golang:1.22.0-alpine3.19 as build

ARG VERSION \
GIT_COMMIT \
Expand Down
13 changes: 12 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
FROM cosmtrek/air:v1.49.0
FROM cosmtrek/air:v1.49.0 as air


FROM golang:1.22.0-alpine3.19

WORKDIR /app

RUN apk add --no-cache curl

COPY --from=air /go/bin/air /go/bin/air

EXPOSE 9198

HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl -f http://localhost:9198/healthcheck

ENTRYPOINT ["/go/bin/air", "-c", ".air.toml"]
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/kuskoman/logstash-exporter

go 1.21.0

toolchain go1.21.4
go 1.22.0

require (
github.com/joho/godotenv v1.5.1
Expand Down

0 comments on commit a1247fd

Please sign in to comment.