From 62a3fd8d32b698dee400419d6d6e48971fa2d827 Mon Sep 17 00:00:00 2001 From: Andres Almiray Date: Fri, 21 May 2021 18:55:47 +0200 Subject: [PATCH] Document HTTP uploads. https://github.com/jreleaser/jreleaser/issues/162 --- docs/modules/configuration/nav.adoc | 1 + .../configuration/pages/announce/discord.adoc | 3 + .../pages/announce/discussions.adoc | 3 + .../configuration/pages/announce/gitter.adoc | 3 + .../configuration/pages/announce/mail.adoc | 3 + .../pages/announce/mastodon.adoc | 3 + .../configuration/pages/announce/sdkman.adoc | 3 + .../configuration/pages/announce/slack.adoc | 3 + .../configuration/pages/announce/teams.adoc | 3 + .../configuration/pages/announce/twitter.adoc | 3 + .../configuration/pages/announce/zulip.adoc | 3 + .../configuration/pages/assemble/jlink.adoc | 3 + .../pages/assemble/native-image.adoc | 3 + .../configuration/pages/environment.adoc | 9 + .../pages/upload/artifactory.adoc | 23 +- .../configuration/pages/upload/http.adoc | 524 ++++++++++++++++++ 16 files changed, 581 insertions(+), 12 deletions(-) create mode 100644 docs/modules/configuration/pages/upload/http.adoc diff --git a/docs/modules/configuration/nav.adoc b/docs/modules/configuration/nav.adoc index c9cb513..33f6f9b 100644 --- a/docs/modules/configuration/nav.adoc +++ b/docs/modules/configuration/nav.adoc @@ -21,6 +21,7 @@ *** xref:packagers/snap.adoc[] ** xref:upload/index.adoc[] *** xref:upload/artifactory.adoc[] +*** xref:upload/http.adoc[] ** xref:distributions.adoc[] ** xref:files.adoc[] ** xref:announce/index.adoc[] diff --git a/docs/modules/configuration/pages/announce/discord.adoc b/docs/modules/configuration/pages/announce/discord.adoc index 99d70df..1e2c4b8 100644 --- a/docs/modules/configuration/pages/announce/discord.adoc +++ b/docs/modules/configuration/pages/announce/discord.adoc @@ -151,6 +151,9 @@ Maven:: [subs="+macros,verbatim"] ---- + - pass:[https:my.zulipchat.com/api/v1] + pass:[https://duke.jfrog.io/artifactory/binaries/{{projectName}}/{{projectVersion}}] + + + + + + + ALWAYS + + + 20 + + + 60 + + + pass:[https:my.zulipchat.com/api/v1] + + + __DO_NOT_SET_HERE__ + + + __DO_NOT_SET_HERE__ + + + BASIC + + + POST + + + + {{artifactPlatform}} + + + + true + + + true + + + true + + + + + bar + + + + + +---- +Gradle:: ++ +[source,groovy] +[subs="+macros"] +---- +jreleaser { + // icon:dot-circle[] + upload { + // icon:dot-circle[] + http { + // Uploaders require a name. + // icon:exclamation-triangle[] + app { + + // Enables or disables the uploader. + // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`]. + // Defaults to `NEVER`. + // icon:dot-circle[] + active = 'ALWAYS' + + // Defines the connection timeout in seconds. + // Defaults to `20`. + // icon:dot-circle[] + connectTimeout = 20 + + // Defines the read timeout in seconds. + // Defaults to `60`. + // icon:dot-circle[] + readTimeout = 60 + + // URL of the HTTP/HTTPS server + path. + // The artifact file name will be appended automatically. + // icon:exclamation-triangle[] icon:file-alt[] + target = 'pass:[https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFileName}}]' + + // The username required for authorization. + // If left unspecified, the `JRELEASER_HTTP_${name}_USERNAME` + // environment variable must be defined. + // icon:dot-circle[] icon:eye-slash[] + username = '__DO_NOT_SET_HERE__' + + // Password for login into the repository. + // If left unspecified, the `JRELEASER_HTTP_${name}_PASSWORD` + // environment variable must be defined. + // icon:dot-circle[] icon:eye-slash[] + password = '__DO_NOT_SET_HERE__' + + // The authorization method to use. + // Valid values are [`NONE`, `BASIC`, `BEARER`]. + // `Basic` requires both username & password. + // `BEARER` requires a token (set as password). + // Defaults to `NONE`. + // icon:dot-circle[] + authorization = 'BASIC' + + // The method to use for uploading artifacts. + // Valid values are [`POST`, `PUT`]. + // Defaults to `PUT`. + // icon:dot-circle[] + method = 'POST' + + // Additional headers to be sent to the server. + // Values accept xref:configuration:name-templates.adoc[]. + // icon:dot-circle[] icon:file-alt[] + headers.put('X-ARTIFACT-PLATFORM', '{{artifactPlatform}}') + + // Upload files. + // Defaults to `true`. + // icon:dot-circle[] + files = true + + // Upload distribution artifacts. + // Defaults to `true`. + // icon:dot-circle[] + artifacts = true + + // Upload signatures. + // Defaults to `true`. + // icon:dot-circle[] + signatures = true + + // Additional properties used when evaluating templates. + // Key will be capitalized and prefixed with `http`, i.e, `httpFoo`. + // icon:dot-circle[] + extraProperties.put('foo', 'bar') + } + } + } +} +---- +==== + +== Target + +The target is the URL to upload the artifacts to. + +An example configuration can look like +`target: 'https://artifacts.company.com:8081/upload/{{projectName}}/{{tagName}}/{{artifactFileName}}'`. + +And will result in a final deployment like +`pass:[https://artifacts.company.com:8081/upload/app/v1.0.0/app-1.0.0.zip]`. + +== Username + +You can have the username set in the configuration as shown above or you can have it read from an environment variable. +The configured name of the HTTP server will be used to build the environment variable name. +This means that the name per configured instance needs to be unique. + +The name of the environment variable will be `JRELEASER_HTTP_NAME_USERNAME`. If your instance is named `production`, +you can store the username in the environment variable `JRELEASER_HTTP_PRODUCTION_USERNAME`. The name will be +transformed to uppercase. + +If a configured username is found in the configuration file, then the environment variable is not used at all. + +== Password + +The password will be stored in a environment variable. The configured name of the HTTP server will +be used. This means that the name per configured instance needs to be unique. + +The name of the environment variable will be `JRELEASER_HTTP_NAME_PASSWORD`. If your instance is named `production`, +you need to store the secret in the environment variable `JRELEASER_HTTP_PRODUCTION_PASSWORD`. The name will be +transformed to uppercase. +