From 007857afd5cda7983d6c4eae9dad89dfb4258c17 Mon Sep 17 00:00:00 2001 From: Michael Manganiello Date: Sun, 19 Feb 2023 21:18:51 -0300 Subject: [PATCH] Upgrade to Go 1.20 With the release of Go 1.20, version 1.18 is not supported anymore. This change upgrades the project to Go 1.20. --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/release.yaml | 2 +- CONTRIBUTING.md | 20 ++++++++++---------- docker/Dockerfile | 2 +- docker/Dockerfile.collector | 2 +- docker/Dockerfile.web | 2 +- go.mod | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 211a579..ed629a5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -101,7 +101,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-go@v3 with: - go-version: '^1.18.3' + go-version: '^1.20.1' - name: Build Binaries run: | make binary-clean binary-all @@ -111,4 +111,4 @@ jobs: name: binaries.zip path: | scrutiny-web-* - scrutiny-collector-metrics-* \ No newline at end of file + scrutiny-collector-metrics-* diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2a44423..3977818 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -96,7 +96,7 @@ jobs: name: workspace - uses: actions/setup-go@v3 with: - go-version: '1.18.3' # The Go version to download (if necessary) and use. + go-version: '1.20.1' # The Go version to download (if necessary) and use. - name: Build Binaries run: | make binary-clean binary-all diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a6ad71..ea3fbad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,18 +5,18 @@ The Scrutiny repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) - Scrutiny Frontend Angular SPA - S.M.A.R.T Collector -Depending on the functionality you are adding, you may need to setup a development environment for 1 or more projects. +Depending on the functionality you are adding, you may need to setup a development environment for 1 or more projects. # Modifying the Scrutiny Backend Server (API) -1. install the [Go runtime](https://go.dev/doc/install) (v1.18+) +1. install the [Go runtime](https://go.dev/doc/install) (v1.20+) 2. download the `scrutiny-web-frontend.tar.gz` for the [latest release](https://github.com/AnalogJ/scrutiny/releases/latest). Extract to a folder named `dist` 3. create a `scrutiny.yaml` config file ```yaml # config file for local development. store as scrutiny.yaml version: 1 - + web: listen: port: 8080 @@ -29,13 +29,13 @@ Depending on the functionality you are adding, you may need to setup a developme path: ./dist influxdb: retention_policy: false - + log: file: 'web.log' #absolute or relative paths allowed, eg. web.log level: DEBUG ``` -4. start a InfluxDB docker container. +4. start a InfluxDB docker container. ```bash docker run -p 8086:8086 --rm influxdb:2.2 ``` @@ -60,16 +60,16 @@ The frontend is written in Angular. If you're working on the frontend and can us 3. open your browser and visit [http://localhost:4200/web](http://localhost:4200/web) # Modifying both Scrutiny Backend and Frontend Applications -If you're developing a feature that requires changes to the backend and the frontend, or a frontend feature that requires real data, +If you're developing a feature that requires changes to the backend and the frontend, or a frontend feature that requires real data, you'll need to follow the steps below: -1. install the [Go runtime](https://go.dev/doc/install) (v1.18+) +1. install the [Go runtime](https://go.dev/doc/install) (v1.20+) 2. install [NodeJS](https://nodejs.org/en/download/) 3. create a `scrutiny.yaml` config file ```yaml # config file for local development. store as scrutiny.yaml version: 1 - + web: listen: port: 8080 @@ -82,7 +82,7 @@ you'll need to follow the steps below: path: ./dist influxdb: retention_policy: false - + log: file: 'web.log' #absolute or relative paths allowed, eg. web.log level: DEBUG @@ -185,4 +185,4 @@ docker run -p 8086:8086 -d --rm \ influxdb:2.2 go test ./... -``` \ No newline at end of file +``` diff --git a/docker/Dockerfile b/docker/Dockerfile index 7d35bef..98f1a73 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,7 +5,7 @@ ######## -FROM golang:1.18-bullseye as backendbuild +FROM golang:1.20-bullseye as backendbuild WORKDIR /go/src/github.com/analogj/scrutiny COPY . /go/src/github.com/analogj/scrutiny diff --git a/docker/Dockerfile.collector b/docker/Dockerfile.collector index 2839bdf..0cc9c12 100644 --- a/docker/Dockerfile.collector +++ b/docker/Dockerfile.collector @@ -4,7 +4,7 @@ ######## -FROM golang:1.18-bullseye as backendbuild +FROM golang:1.20-bullseye as backendbuild WORKDIR /go/src/github.com/analogj/scrutiny diff --git a/docker/Dockerfile.web b/docker/Dockerfile.web index 8d1192c..5e59986 100644 --- a/docker/Dockerfile.web +++ b/docker/Dockerfile.web @@ -5,7 +5,7 @@ ######## -FROM golang:1.18-bullseye as backendbuild +FROM golang:1.20-bullseye as backendbuild WORKDIR /go/src/github.com/analogj/scrutiny diff --git a/go.mod b/go.mod index daa70d2..04a9e91 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/analogj/scrutiny -go 1.18 +go 1.20 require ( github.com/analogj/go-util v0.0.0-20190301173314-5295e364eb14