Skip to content

Commit

Permalink
Bump dependencies to fix Semaphore CI (#1427)
Browse files Browse the repository at this point in the history
* bump version of deps

* use go1.19

* remove trailing 0

* fix lint

* temporarily remove golicense and deprecated functions

* fix tests

* fix completion tests

* fix go version in urls

* trigger ci

* sort imports

* update pem

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* skip existing
  • Loading branch information
brianstrauch authored Oct 6, 2022
1 parent fd1c8f7 commit cac9b43
Show file tree
Hide file tree
Showing 76 changed files with 1,042 additions and 1,836 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.6
1.19.0
25 changes: 10 additions & 15 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ blocks:
- source script.sh

# Set up Go
- sem-version go 1.17.6
- export "GOPATH=$(go env GOPATH)"
- export "PATH=$GOPATH/bin:$PATH"
- checkout
- goenv install --skip-existing
- export "PATH=$(go env GOPATH)/bin:$PATH"

# Try to restore cached dependencies
- cache restore linux-$(checksum go.sum)

# Set up Git
- checkout
- export "GOPRIVATE=github.com/confluentinc"
- git config --global url."[email protected]:".insteadOf "https://github.com/"

Expand All @@ -53,10 +52,10 @@ blocks:
- make lint
- ulimit -n 2048
- make test
- make lint-licenses
# - make lint-licenses

# Cache Go dependencies
- cache store linux-$(checksum go.sum) $GOPATH/pkg/mod
- cache store linux-$(checksum go.sum) $(go env GOPATH)/pkg/mod
epilogue:
always:
commands:
Expand All @@ -77,15 +76,11 @@ blocks:
- source script.sh

# Set up Go
- wget https://golang.org/dl/go1.17.6.darwin-amd64.tar.gz
- sudo tar -xzf go1.17.6.darwin-amd64.tar.gz -C /usr/local/
- export "PATH=/usr/local/go/bin:$PATH"
- export "GOPATH=$(go env GOPATH)"
- export "PATH=$GOPATH/bin:$PATH"
- export "PATH=$GOROOT/bin:$PATH"
- checkout
- goenv install --skip-existing
- export "PATH=$(go env GOPATH)/bin:$PATH"

# Set up Git
- checkout
- export "GOPRIVATE=github.com/confluentinc"
- git config --global url."[email protected]:".insteadOf "https://github.com/"

Expand Down Expand Up @@ -119,8 +114,8 @@ blocks:
# - [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(Get-Content id_rsa.b64)) | Out-File -Encoding "ASCII" .ssh\id_rsa

# Set up Go
# - Invoke-WebRequest https://golang.org/dl/go1.17.6.windows-amd64.zip -OutFile go1.17.6.windows-amd64.zip
# - Expand-Archive go1.17.6.windows-amd64.zip -DestinationPath /usr/local/
# - Invoke-WebRequest https://golang.org/dl/go${GO_VERSION}.windows-amd64.zip -OutFile go${GO_VERSION}.windows-amd64.zip
# - Expand-Archive go${GO_VERSION}.windows-amd64.zip -DestinationPath /usr/local/
# - $Env:PATH = "/usr/local/go/bin:$Env:PATH"
# - $Env:PATH = "$(go env GOPATH)/bin:$Env:PATH"

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Start by following these steps to set up your computer for CLI development:

#### Go Version

This repo requires go1.17.6. We recommend you use [goenv](https://github.com/syndbg/goenv) to manage your Go versions.
We recommend you use [goenv](https://github.com/syndbg/goenv) to manage your Go versions.
There's a `.go-version` file in this repo with the exact version we use (and test against in CI).

We recommend cloning the `goenv` repo directly to ensure that you have access to the latest version of Go. If you've
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def job = {
"gradle.properties", "GRADLE_PROPERTIES_FILE"]]) {
sh '''#!/usr/bin/env bash
export HASH=$(git rev-parse --short=7 HEAD)
wget "https://golang.org/dl/go1.17.6.linux-amd64.tar.gz" --quiet --output-document go1.17.6.tar.gz
tar -C $(pwd) -xzf go1.17.6.tar.gz
wget "https://golang.org/dl/go1.19.linux-amd64.tar.gz" --quiet --output-document go1.19.tar.gz
tar -C $(pwd) -xzf go1.19.tar.gz
export GOROOT=$(pwd)/go
export GOPATH=$(pwd)/go/path
export GOBIN=$(pwd)/go/bin
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ generate:

.PHONY: deps
deps:
go install github.com/goreleaser/[email protected] && \
go install github.com/golangci/golangci-lint/cmd/[email protected] && \
go install github.com/mitchellh/[email protected] && \
go install github.com/goreleaser/[email protected] && \
go install github.com/golangci/golangci-lint/cmd/[email protected] && \
go install gotest.tools/[email protected]

.PHONY: jenkins-deps
Expand Down
18 changes: 9 additions & 9 deletions azure-pipelines-templates/setup-go.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
steps:
- script: |
wget "https://golang.org/dl/go1.17.6.linux-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.17.6.tar.gz"
tar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.17.6.tar.gz"
wget "https://golang.org/dl/go1.19.linux-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.19.tar.gz"
tar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.19.tar.gz"
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Install Go 1.17.6 (Linux)
displayName: Install Go 1.19 (Linux)

- script: |
brew install gnu-tar
Expand All @@ -18,17 +18,17 @@ steps:
displayName: Install chrome (Darwin)

- script: |
wget "https://golang.org/dl/go1.17.6.darwin-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.17.6.tar.gz"
gtar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.17.6.tar.gz"
wget "https://golang.org/dl/go1.19.darwin-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.19.tar.gz"
gtar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.19.tar.gz"
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: Install Go 1.17.6 (Darwin)
displayName: Install Go 1.19 (Darwin)

- powershell: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://golang.org/dl/go1.17.6.windows-amd64.zip" -OutFile "$(Agent.BuildDirectory)\go1.17.6.zip" -Verbose
& ${env:ProgramFiles}\7-Zip\7z.exe x $(Agent.BuildDirectory)/go1.17.6.zip "-o$(Agent.BuildDirectory)" -y
Invoke-WebRequest -Uri "https://golang.org/dl/go1.19.windows-amd64.zip" -OutFile "$(Agent.BuildDirectory)\go1.19.zip" -Verbose
& ${env:ProgramFiles}\7-Zip\7z.exe x $(Agent.BuildDirectory)/go1.19.zip "-o$(Agent.BuildDirectory)" -y
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install Go 1.17.6 (Windows)
displayName: Install Go 1.19 (Windows)

- powershell: |
$ProgressPreference = 'SilentlyContinue'
Expand Down
7 changes: 3 additions & 4 deletions cmd/golicense-downloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -81,7 +80,7 @@ func main() {
// Load config file, if any
config := &Config{}
if *configFile != "" {
b, err := ioutil.ReadFile(*configFile)
b, err := os.ReadFile(*configFile)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to read config file at %s: %s", *configFile, err)
os.Exit(1)
Expand Down Expand Up @@ -225,7 +224,7 @@ func (g *LicenseDownloader) DownloadLicense(ctx context.Context, owner, repo str
}
return nil
}
return ioutil.WriteFile(fmt.Sprintf(g.LicenseFmt, owner, repo), []byte(license), os.ModePerm)
return os.WriteFile(fmt.Sprintf(g.LicenseFmt, owner, repo), []byte(license), os.ModePerm)
}

func (g *LicenseDownloader) DownloadNotice(ctx context.Context, owner, repo string) error {
Expand All @@ -236,7 +235,7 @@ func (g *LicenseDownloader) DownloadNotice(ctx context.Context, owner, repo stri
if notice == "" {
return nil
}
return ioutil.WriteFile(fmt.Sprintf(g.NoticeFmt, owner, repo), []byte(notice), os.ModePerm)
return os.WriteFile(fmt.Sprintf(g.NoticeFmt, owner, repo), []byte(notice), os.ModePerm)
}

func (g *LicenseDownloader) GetLicense(ctx context.Context, owner, repo string) (string, error) {
Expand Down
9 changes: 4 additions & 5 deletions debian/patches/standard_build_layout.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- cli/Makefile 2022-10-03 16:53:23.000000000 -0700
--- cli/Makefile 2022-10-05 15:39:01.000000000 -0700
+++ debian/Makefile 2022-07-12 14:17:45.000000000 -0700
@@ -1,211 +1,130 @@
@@ -1,210 +1,130 @@
-SHELL := /bin/bash
-ALL_SRC := $(shell find . -name "*.go" | grep -v -e vendor)
-GIT_REMOTE_NAME ?= origin
Expand Down Expand Up @@ -89,9 +89,8 @@
-
-.PHONY: deps
-deps:
- go install github.com/goreleaser/[email protected] && \
- go install github.com/golangci/golangci-lint/cmd/[email protected] && \
- go install github.com/mitchellh/[email protected] && \
- go install github.com/goreleaser/[email protected] && \
- go install github.com/golangci/golangci-lint/cmd/[email protected] && \
- go install gotest.tools/[email protected]
-
-.PHONY: jenkins-deps
Expand Down
Loading

0 comments on commit cac9b43

Please sign in to comment.