diff --git a/go.mod b/go.mod index d6a7f90..d9204ff 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,25 @@ module github.com/screwdriver-cd/launcher -go 1.16 +go 1.19 require ( github.com/creack/pty v1.1.11 github.com/google/uuid v1.2.0 github.com/hashicorp/go-retryablehttp v0.6.6 - github.com/mattn/go-colorable v0.1.6 // indirect - github.com/myesui/uuid v1.0.0 // indirect github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721 github.com/stretchr/testify v1.2.2 github.com/urfave/cli v1.22.2 - golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 // indirect gopkg.in/fatih/color.v1 v1.7.0 - gopkg.in/stretchr/testify.v1 v1.2.2 // indirect +) + +require ( + github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/hashicorp/go-cleanhttp v0.5.1 // indirect + github.com/mattn/go-colorable v0.1.6 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + golang.org/x/sys v0.2.0 // indirect ) diff --git a/go.sum b/go.sum index 4cbe6ad..9a34526 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,6 @@ github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+v github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/myesui/uuid v1.0.0 h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI= -github.com/myesui/uuid v1.0.0/go.mod h1:2CDfNgU0LR8mIdO8vdWd8i9gWWxLlcoIGGpSNgafq84= github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721 h1:ArxMo6jAOO2KuRsepZ0hTaH4hZCi2CCW4P9PV59HHH0= github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721/go.mod h1:jQyRpOpE/KbvPc0VKXjAqctYglwUO5W6zAcGcFfbvlo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -33,11 +31,9 @@ github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 h1:bNEHhJCnrwMKNMmOx3yAynp5vs5/gRy+XWFtZFu7NBM= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fatih/color.v1 v1.7.0 h1:bYGjb+HezBM6j/QmgBfgm1adxHpzzrss6bj4r9ROppk= gopkg.in/fatih/color.v1 v1.7.0/go.mod h1:P7yosIhqIl/sX8J8UypY5M+dDpD2KmyfP5IRs5v/fo0= -gopkg.in/stretchr/testify.v1 v1.2.2 h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M= -gopkg.in/stretchr/testify.v1 v1.2.2/go.mod h1:QI5V/q6UbPmuhtm10CaFZxED9NreB8PnFYN9JcR6TxU= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/launch.go b/launch.go index f45b8f4..a036e74 100644 --- a/launch.go +++ b/launch.go @@ -74,14 +74,16 @@ func init() { client = retryablehttp.NewClient() } -/* has HTTP or HTTPS protocol +/* +has HTTP or HTTPS protocol targetURL => URL */ func hasHTTPProtocol(targetURL *url.URL) bool { return targetURL.Scheme == "http" || targetURL.Scheme == "https" } -/* make pushgateway url +/* +make pushgateway url baseURL => base url for pushgateway buildID => sd build id */ @@ -100,7 +102,8 @@ func makePushgatewayURL(baseURL string, buildID int) (string, error) { return u.String(), nil } -/* push metrics to prometheus +/* +push metrics to prometheus metrics - sd_build_completed, sd_build_run_duration_secs status => sd build status buildID => sd build id @@ -230,8 +233,8 @@ type Workspace struct { // createWorkspace makes a Scrwedriver workspace from path components // e.g. ["github.com", "screwdriver-cd" "screwdriver"] creates -// /sd/workspace/src/github.com/screwdriver-cd/screwdriver -// /sd/workspace/artifacts +// /sd/workspace/src/github.com/screwdriver-cd/screwdriver +// /sd/workspace/artifacts func createWorkspace(isLocal bool, rootDir string, srcPaths ...string) (Workspace, error) { srcPaths = append([]string{"src"}, srcPaths...) src := path.Join(srcPaths...) diff --git a/screwdriver.yaml b/screwdriver.yaml index d4ae5fd..0bfde2c 100644 --- a/screwdriver.yaml +++ b/screwdriver.yaml @@ -4,7 +4,7 @@ shared: GO111MODULE: on jobs: main: - image: golang:1.17 + image: golang:1.19 environment: SD_SONAR_OPTS: "-Dsonar.sources=./ -Dsonar.exclusions=**/*_test.go,**/vendor/** -Dsonar.tests=./ -Dsonar.test.inclusions=**/*_test.go -Dsonar.test.exclusions=**/vendor/** -Dsonar.go.coverage.reportPaths=${SD_ARTIFACTS_DIR}/coverage.out -Dsonar.go.tests.reportPaths=${SD_ARTIFACTS_DIR}/report.json" requires: [~commit, ~pr] @@ -13,14 +13,14 @@ jobs: - install: go mod download - vet: go vet ./... - gofmt: (! gofmt -d . | grep '^') - - test-setup: go get gotest.tools/gotestsum@v0.6.0 + - test-setup: go install gotest.tools/gotestsum@latest - test: gotestsum --format testname --jsonfile ${SD_ARTIFACTS_DIR}/report.json -- -coverprofile=${SD_ARTIFACTS_DIR}/coverage.out ./... # Ensure we can compile - build: go build -a -o /dev/null # Test cross-compiling as well - test-release: "curl -sL https://git.io/goreleaser | bash -s -- --snapshot" publish: - image: golang:1.17 + image: golang:1.19 requires: main steps: - setup-ci: git clone https://github.com/screwdriver-cd/toolbox.git ci