Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump go to 1.20, address deprecations #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pipeline {
}
}
steps {
goreleaser snapshot: true
goreleaser goVersion: '1.20.5', snapshot: true
archiveArtifacts artifacts: 'dist/*.zip', fingerprint: true
}
}
Expand Down
3 changes: 2 additions & 1 deletion example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM jenkins/jenkins:lts

RUN /usr/local/bin/install-plugins.sh hashicorp-vault-plugin cloudbees-folder pipeline-model-definition git matrix-auth
RUN jenkins-plugin-cli --plugins \
hashicorp-vault-plugin cloudbees-folder pipeline-model-definition git matrix-auth

HEALTHCHECK --interval=4s --start-period=5s --retries=30 CMD [ "curl", "-f", "http://localhost:8080" ]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kingsoftgames/terraform-provider-jenkins

go 1.18
go 1.20

require (
github.com/bndr/gojenkins v1.1.1-0.20210407143218-9e2483ff7ebd
Expand Down
3 changes: 1 addition & 2 deletions jenkins/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package jenkins
import (
"context"
"io"
"io/ioutil"
"strings"

jenkins "github.com/bndr/gojenkins"
Expand Down Expand Up @@ -34,7 +33,7 @@ func newJenkinsClient(c *Config) *jenkinsAdapter {
client := jenkins.CreateJenkins(nil, c.ServerURL, c.Username, c.Password)
if c.CACert != nil {
// provide CA certificate if server is using self-signed certificate
client.Requester.CACert, _ = ioutil.ReadAll(c.CACert)
client.Requester.CACert, _ = io.ReadAll(c.CACert)
}

// return the Jenkins API client
Expand Down
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ test:

# Executes all acceptance tests for the provider
testacc:
@docker-compose build
@docker-compose up -d --force-recreate jenkins
@docker compose build
@docker compose up -d --force-recreate jenkins
@while [ "$$(docker inspect jenkins-provider-acc --format '{{ .State.Health.Status }}')" != "healthy" ]; do echo "Waiting for Jenkins to start..."; sleep 3; done
TF_ACC=1 JENKINS_URL="http://localhost:8080" JENKINS_USERNAME="admin" JENKINS_PASSWORD="admin" go test -v -cover ./...
@docker-compose down
@docker compose down

# Cleans up any lingering items in your system created by this provider.
clean:
Expand Down