grafana/scripts/build/release_publisher/main.go

81 lines
2.5 KiB
Go
Raw Normal View History

package main
import (
"flag"
"fmt"
"log"
"os"
)
func main() {
var version string
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
var whatsNewURL string
var releaseNotesURL string
var dryRun bool
var enterprise bool
var nightly bool
var apiKey string
flag.StringVar(&version, "version", "", "Grafana version (ex: --version v5.2.0-beta1)")
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
flag.StringVar(&whatsNewURL, "wn", "", "What's new url (ex: --wn http://docs.grafana.org/guides/whats-new-in-v5-2/)")
flag.StringVar(&releaseNotesURL, "rn", "", "Grafana version (ex: --rn https://community.grafana.com/t/release-notes-v5-2-x/7894)")
flag.StringVar(&apiKey, "apikey", "", "Grafana.com API key (ex: --apikey ABCDEF)")
flag.BoolVar(&dryRun, "dry-run", false, "--dry-run")
flag.BoolVar(&enterprise, "enterprise", false, "--enterprise")
2019-03-22 15:53:02 -05:00
flag.BoolVar(&nightly, "nightly", false, "--nightly (default: false)")
flag.Parse()
if len(os.Args) == 1 {
fmt.Println("Usage: go run publisher.go main.go --version <v> --wn <what's new url> --rn <release notes url> --apikey <api key> --dry-run false --enterprise false --nightly false")
fmt.Println("example: go run publisher.go main.go --version v5.2.0-beta2 --wn http://docs.grafana.org/guides/whats-new-in-v5-2/ --rn https://community.grafana.com/t/release-notes-v5-2-x/7894 --apikey ASDF123 --dry-run --enterprise")
os.Exit(1)
}
if dryRun {
log.Println("Dry-run has been enabled.")
}
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
var baseURL string
var builder releaseBuilder
var product string
archiveProviderRoot := "https://dl.grafana.com"
buildArtifacts := completeBuildArtifactConfigurations
if enterprise {
product = "grafana-enterprise"
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
baseURL = createBaseURL(archiveProviderRoot, "enterprise", product, nightly)
} else {
product = "grafana"
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
baseURL = createBaseURL(archiveProviderRoot, "oss", product, nightly)
}
2019-03-22 15:53:02 -05:00
builder = releaseFromExternalContent{
getter: getHTTPContents{},
rawVersion: version,
artifactConfigurations: buildArtifacts,
}
p := publisher{
apiKey: apiKey,
apiURI: "https://grafana.com/api",
product: product,
dryRun: dryRun,
enterprise: enterprise,
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
baseArchiveURL: baseURL,
builder: builder,
}
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
if err := p.doRelease(whatsNewURL, releaseNotesURL, nightly); err != nil {
log.Fatalf("error: %v", err)
}
}
scripts/build/*: Fix golint issues Url => URL $ gometalinter --vendor --disable-all --enable=golint ./... | grep -i URL build/publish.go:18:5:warning: var apiUrl should be apiURL (golint) build/publish.go:184:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/publish.go:185:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/publish.go:191:2:warning: struct field Url should be URL (golint) build/release_publisher/externalrelease.go:17:53:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/externalrelease.go:17:69:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/externalrelease.go:17:89:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:20:45:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:20:61:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/localrelease.go:20:81:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/localrelease.go:45:41:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/localrelease.go:51:84:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/main.go:12:6:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/main.go:13:6:warning: var releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/main.go:40:6:warning: var baseUrl should be baseURL (golint) build/release_publisher/main.go:94:6:warning: func createBaseUrl should be createBaseURL (golint) build/release_publisher/publisher.go:21:2:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:17:warning: interface method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:26:33:warning: interface method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:26:53:warning: interface method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:29:31:warning: method parameter whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher.go:29:51:warning: method parameter releaseNotesUrl should be releaseNotesURL (golint) build/release_publisher/publisher.go:91:24:warning: method getUrl should be getURL (golint) build/release_publisher/publisher.go:91:31:warning: method parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:190:15:warning: func parameter baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher.go:199:21:warning: method apiUrl should be apiURL (golint) build/release_publisher/publisher.go:257:2:warning: struct field WhatsNewUrl should be WhatsNewURL (golint) build/release_publisher/publisher.go:258:2:warning: struct field ReleaseNotesUrl should be ReleaseNotesURL (golint) build/release_publisher/publisher.go:264:2:warning: struct field Url should be URL (golint) build/release_publisher/publisher_test.go:10:3:warning: struct field whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:11:3:warning: struct field relNotesUrl should be relNotesURL (golint) build/release_publisher/publisher_test.go:17:3:warning: struct field expectedUrl should be expectedURL (golint) build/release_publisher/publisher_test.go:18:3:warning: struct field baseArchiveUrl should be baseArchiveURL (golint) build/release_publisher/publisher_test.go:109:2:warning: var whatsNewUrl should be whatsNewURL (golint) build/release_publisher/publisher_test.go:110:2:warning: var relNotesUrl should be relNotesURL (golint)
2019-01-22 12:45:01 -06:00
func createBaseURL(root string, bucketName string, product string, nightly bool) string {
var subPath string
if nightly {
subPath = "main"
} else {
subPath = "release"
}
return fmt.Sprintf("%s/%s/%s/%s", root, bucketName, subPath, product)
}