Sftp

Uploads artifacts, files, and signatures to a SFTP server.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
upload:
  # 
  sftp:
    # Uploaders require a name.
    # 
    app:

      # Enables or disables the uploader.
      # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      # Defaults to `NEVER`.
      #  
      active: ALWAYS

      # Defines the connection timeout in seconds.
      # Defaults to `20`.
      # 
      connectTimeout: 20

      # Defines the read timeout in seconds.
      # Defaults to `60`.
      # 
      readTimeout: 60

      # Upload files.
      # Defaults to `true`.
      # 
      files: true

      # Upload distribution artifacts.
      # Defaults to `true`.
      # 
      artifacts: true

      # Release checksum files.
      # Defaults to `true`.
      # 
      checksums: true

      # Upload signatures.
      # Defaults to `true`.
      # 
      signatures: true

      # Upload catalogs.
      # Defaults to `true`.
      # 
      catalogs: true

      # Additional properties used when evaluating templates.
      # 
      extraProperties:
        # Key will be capitalized and prefixed with `sftp`, i.e, `sftpFoo`.
        foo: bar

      # Host where the SFTP service is enabled.
      #  
      host: uploads.acme.com

      # Port number of SFTP service.
      # Defaults to `22`.
      #  
      port: 22

      # The username required for authorization.
      #  
      username: __USE_ENVIRONMENT_VARIABLE__

      # Password for login into the SFTP service.
      #  
      password: __USE_ENVIRONMENT_VARIABLE__

      # The public SSH key.
      #  
      publicKey: __USE_ENVIRONMENT_VARIABLE__

      # The private SSH key.
      #  
      privateKey: __USE_ENVIRONMENT_VARIABLE__

      # The passphrase required to read private keys.
      #  
      passphrase: __USE_ENVIRONMENT_VARIABLE__

      # The remote server's SSH fingerprint.
      #  
      fingerprint: __USE_ENVIRONMENT_VARIABLE__

      # Path where artifacts will be uploaded.
      #  
      path: '/uploads/{{projectName}}/{{tagName}}/{{artifactFile}}'

      # An HTTP/HTTPS URL from where artifacts may be downloaded.
      #  
      downloadUrl: 'https://download.acme.com/{{projectName}}/{{tagName}}/{{artifactFile}}'
# Uploaders require a name.
# 
[upload.sftp.app]

  # Enables or disables the uploader.
  # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  #  
  active = "ALWAYS"

  # Defines the connection timeout in seconds.
  # Defaults to `20`.
  # 
  connectTimeout = 20

  # Defines the read timeout in seconds.
  # Defaults to `60`.
  # 
  readTimeout = 60

  # Upload files.
  # Defaults to `true`.
  # 
  files = true

  # Upload distribution artifacts.
  # Defaults to `true`.
  # 
  artifacts = true

  # Release checksum files.
  # Defaults to `true`.
  # 
  checksums = true

  # Upload signatures.
  # Defaults to `true`.
  # 
  signatures = true

  # Upload catalogs.
  # Defaults to `true`.
  # 
  catalogs = true

  # Additional properties used when evaluating templates.
  # 
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `sftp`, i.e, `sftpFoo`.

  # Host where the SFTP service is enabled.
  #  
  host = "uploads.acme.com"

  # Port number of SFTP service.
  # Defaults to `port`.
  #  
  port = 22

  # The username required for authorization.
  #  
  username = "__USE_ENVIRONMENT_VARIABLE__"

  # Password for login into the SFTP service.
  #  
  password = "__USE_ENVIRONMENT_VARIABLE__"

  # The public SSH key.
  #  
  publicKey = "__USE_ENVIRONMENT_VARIABLE__"

  # The private SSH key.
  #  
  privateKey = "__USE_ENVIRONMENT_VARIABLE__"

  # The passphrase required to read private keys.
  #  
  passphrase = "__USE_ENVIRONMENT_VARIABLE__"

  # The remote server's SSH fingerprint.
  #  
  fingerprint = "__USE_ENVIRONMENT_VARIABLE__"

  # Path where artifacts will be uploaded.
  #  
  path = "/uploads/{{projectName}}/{{tagName}}/{{artifactFile}}"

  # An HTTP/HTTPS URL from where artifacts may be downloaded.
  #  
  downloadUrl = "https://download.acme.com/{{projectName}}/{{tagName}}/{{artifactFile}}"
{
  // 
  "upload": {
    // 
    "sftp": {
      // Uploaders require a name.
      // 
      "app": {

        // Enables or disables the uploader.
        // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        // Defaults to `NEVER`.
        //  
        "active": "ALWAYS",

        // Defines the connection timeout in seconds.
        // Defaults to `20`.
        // 
        "connectTimeout": 20,

        // Defines the read timeout in seconds.
        // Defaults to `60`.
        // 
        "readTimeout": 60,

        // Upload files.
        // Defaults to `true`.
        // 
        "files": true,

        // Upload distribution artifacts.
        // Defaults to `true`.
        // 
        "artifacts": true,

        // Release checksum files.
        // Defaults to `true`.
        // 
        "checksums": true,

        // Upload signatures.
        // Defaults to `true`.
        // 
        "signatures": true,

        // Upload catalogs.
        // Defaults to `true`.
        // 
        "catalogs": true,

        // Additional properties used when evaluating templates.
        // 
        "extraProperties": {
          // Key will be capitalized and prefixed with `sftp`, i.e, `sftpFoo`.
          "foo": "bar"
        },

        // Host where the SFTP service is enabled.
        // If left unspecified, the `JRELEASER_SFTP_${name}_HOST`
        // environment variable must be defined.
        //  
        "host": "uploads.acme.com",

        // Port number of SFTP service.
        // If left unspecified, the `JRELEASER_SFTP_${name}_PORT`
        // environment variable must be defined.
        // Defaults to `22`.
        //  
        "port": 22,

        // The username required for authorization.
        // If left unspecified, the `JRELEASER_SFTP_${name}_USERNAME`
        // environment variable must be defined.
        //  
        "username": "__USE_ENVIRONMENT_VARIABLE__",

        // Password for login into the SFTP service.
        // If left unspecified, the `JRELEASER_SFTP_${name}_PASSWORD`
        // environment variable must be defined.
        //  
        "password": "__USE_ENVIRONMENT_VARIABLE__",

        // The public SSH key.
        //  
        "publicKey": "__USE_ENVIRONMENT_VARIABLE__",

        // The private SSH key.
        //  
        "privateKey": "__USE_ENVIRONMENT_VARIABLE__",

        // The passphrase required to read private keys.
        //  
        "passphrase": "__USE_ENVIRONMENT_VARIABLE__",

        // The remote server's SSH fingerprint.
        //  
        "fingerprint": "__USE_ENVIRONMENT_VARIABLE__",

        // Path where artifacts will be uploaded.
        //  
        "path": "/uploads/{{projectName}}/{{tagName}}/{{artifactFile}}",

        // An HTTP/HTTPS URL from where artifacts may be downloaded.
        //  
        "downloadUrl": "https://download.acme.com/{{projectName}}/{{tagName}}/{{artifactFile}}"
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <upload>
    <!--
      
    -->
    <sftp>
      <!--
        Uploaders require a name.
        
      -->
      <app>
        <!--
          Enables or disables the distribution.
          Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          Defaults to `NEVER`.
           
        -->
        <active>ALWAYS</active>

        <!--
          Defines the connection timeout in seconds.
          Defaults to `20`.
          
        -->
        <connectTimeout>20</connectTimeout>

        <!--
          Defines the read timeout in seconds.
          Defaults to `60`.
          
        -->
        <readTimeout>60</readTimeout>

        <!--
          Upload files.
          Defaults to `true`.
          
        -->
        <files>true</files>

        <!--
          Upload distribution artifacts.
          Defaults to `true`.
          
        -->
        <artifacts>true</artifacts>

        <!--
          Release checksum files.
          Defaults to `true`.
          
        -->
        <checksums>true</checksums>

        <!--
          Upload signatures.
          Defaults to `true`.
          
        -->
        <signatures>true</signatures>

        <!--
          Upload catalogs.
          Defaults to `true`.
          
        -->
        <catalogs>true</catalogs>

        <!--
          Additional properties used when evaluating templates.
          
        -->
        <extraProperties>
          <!--
            Key will be capitalized and prefixed with `sftp`, i.e, `sftpFoo`.
          -->
          <foo>bar</foo>
        </extraProperties>

        <!--
          Host where the SFTP service is enabled.
           
        -->
        <host>uploads.acme.com</host>

        <!--
          Port number of SFTP service.
          Defaults to `22`.
           
        -->
        <port>22</port>

        <!--
          The username required for authorization.
           
        -->
        <username>__USE_ENVIRONMENT_VARIABLE__</username>

        <!--
          Password for login into the SFTP service.
           
        -->
        <password>__USE_ENVIRONMENT_VARIABLE__</password>

        <!--
          The public SSH key.
           
        -->
        <publicKey>__USE_ENVIRONMENT_VARIABLE__</publicKey>

        <!--
          The private SSH key.
           
        -->
        <privateKey>__USE_ENVIRONMENT_VARIABLE__</privateKey>

        <!--
          The passphrase required to read private keys.
           
        -->
        <passphrase>__USE_ENVIRONMENT_VARIABLE__</passphrase>

        <!--
          The remote server's SSH fingerprint.
           
        -->
        <fingerprint>__USE_ENVIRONMENT_VARIABLE__</fingerprint>

        <!--
          Path where artifacts will be uploaded.
           
        -->
        <path>/uploads/{{projectName}}/{{tagName}}/{{artifactFile}}</path>

        <!--
          An HTTP/HTTPS URL from where artifacts may be downloaded.
           
        -->
        <downloadUrl>https://download.acme.com/{{projectName}}/{{tagName}}/{{artifactFile}}</downloadUrl>
      </app>
    </sftp>
  </upload>
</jreleaser>
jreleaser {
  // 
  upload {
    // 
    sftp {
      // Uploaders require a name.
      // 
      app {

        // Enables or disables the uploader.
        // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        // Defaults to `NEVER`.
        //  
        active = 'ALWAYS'

        // Defines the connection timeout in seconds.
        // Defaults to `20`.
        // 
        connectTimeout = 20

        // Defines the read timeout in seconds.
        // Defaults to `60`.
        // 
        readTimeout = 60

        // Upload files.
        // Defaults to `true`.
        // 
        files = true

        // Upload distribution artifacts.
        // Defaults to `true`.
        // 
        artifacts = true

        // Release checksum files.
        // Defaults to `true`.
        // 
        checksums = true

        // Upload signatures.
        // Defaults to `true`.
        // 
        signatures = true

        // Upload catalogs.
        // Defaults to `true`.
        // 
        catalogs = true

        // Additional properties used when evaluating templates.
        // Key will be capitalized and prefixed with `sftp`, i.e, `sftpFoo`.
        // 
        extraProperties.put('foo', 'bar')

        // Host where the SFTP service is enabled.
        //  
        host = 'uploads.acme.com'

        // Port number of SFTP service.
        // Defaults to `22`.
        //  
        port = 22

        // The username required for authorization.
        //  
        username = '__USE_ENVIRONMENT_VARIABLE__'

        // Password for login into the SFTP service.
        //  
        password = '__USE_ENVIRONMENT_VARIABLE__'

        // The public SSH key.
        //  
        publicKey = '__USE_ENVIRONMENT_VARIABLE__'

        // The private SSH key.
        //  
        privateKey = '__USE_ENVIRONMENT_VARIABLE__'

        // The passphrase required to read private keys.
        //  
        passphrase = '__USE_ENVIRONMENT_VARIABLE__'

        // The remote server's SSH fingerprint.
        //  
        fingerprint = '__USE_ENVIRONMENT_VARIABLE__'

        // Path where artifacts will be uploaded.
        //  
        path: '/uploads/{{projectName}}/{{tagName}}/{{artifactFile}}'

        // An HTTP/HTTPS URL from where artifacts may be downloaded.
        //  
        downloadUrl: 'https://download.acme.com/{{projectName}}/{{tagName}}/{{artifactFile}}'
      }
    }
  }
}

Environment

When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.

System Property Environment Variable

active

jreleaser.upload.sftp.${name}.active
jreleaser.upload.sftp.active

JRELEASER_UPLOAD_SFTP_${name}_ACTIVE
JRELEASER_UPLOAD_SFTP_ACTIVE

host

jreleaser.upload.sftp.${name}.host
jreleaser.upload.ssh.${name}.host
jreleaser.upload.sftp.host
jreleaser.upload.ssh.host
jreleaser.sftp.${name}.host
jreleaser.ssh.${name}.host
jreleaser.sftp.host
jreleaser.ssh.host

JRELEASER_UPLOAD_SFTP_${name}_HOST
JRELEASER_UPLOAD_SSH_${name}_HOST
JRELEASER_UPLOAD_SFTP_HOST
JRELEASER_UPLOAD_SSH_HOST
JRELEASER_SFTP_${name}_HOST
JRELEASER_SSH_${name}_HOST
JRELEASER_SFTP_HOST
JRELEASER_SSH_HOST

port

jreleaser.upload.sftp.${name}.port
jreleaser.upload.ssh.${name}.port
jreleaser.upload.sftp.port
jreleaser.upload.ssh.port
jreleaser.sftp.${name}.port
jreleaser.ssh.${name}.port
jreleaser.sftp.port
jreleaser.ssh.port

JRELEASER_UPLOAD_SFTP_${name}_PORT
JRELEASER_UPLOAD_SSH_${name}_PORT
JRELEASER_UPLOAD_SFTP_PORT
JRELEASER_UPLOAD_SSH_PORT
JRELEASER_SFTP_${name}_PORT
JRELEASER_SSH_${name}_PORT
JRELEASER_SFTP_PORT
JRELEASER_SSH_PORT

username

jreleaser.upload.sftp.${name}.username
jreleaser.upload.ssh.${name}.username
jreleaser.upload.sftp.username
jreleaser.upload.ssh.username
jreleaser.sftp.${name}.username
jreleaser.ssh.${name}.username
jreleaser.sftp.username
jreleaser.ssh.username

JRELEASER_UPLOAD_SFTP_${name}_USERNAME
JRELEASER_UPLOAD_SSH_${name}_USERNAME
JRELEASER_UPLOAD_SFTP_USERNAME
JRELEASER_UPLOAD_SSH_USERNAME
JRELEASER_SFTP_${name}_USERNAME
JRELEASER_SSH_${name}_USERNAME
JRELEASER_SFTP_USERNAME
JRELEASER_SSH_USERNAME

password

jreleaser.upload.sftp.${name}.password
jreleaser.upload.ssh.${name}.password
jreleaser.upload.sftp.password
jreleaser.upload.ssh.password
jreleaser.sftp.${name}.password
jreleaser.ssh.${name}.password
jreleaser.sftp.password
jreleaser.ssh.password

JRELEASER_UPLOAD_SFTP_${name}_PASSWORD
JRELEASER_UPLOAD_SSH_${name}_PASSWORD
JRELEASER_UPLOAD_SFTP_PASSWORD
JRELEASER_UPLOAD_SSH_PASSWORD
JRELEASER_SFTP_${name}_PASSWORD
JRELEASER_SSH_${name}_PASSWORD
JRELEASER_SFTP_PASSWORD
JRELEASER_SSH_PASSWORD

publicKey

jreleaser.upload.sftp.${name}.public.key
jreleaser.upload.ssh.${name}.public.key
jreleaser.upload.sftp.public.key
jreleaser.upload.ssh.public.key
jreleaser.sftp.${name}.public.key
jreleaser.ssh.${name}.public.key
jreleaser.sftp.public.key
jreleaser.ssh.public.key

JRELEASER_UPLOAD_SFTP_${name}_PUBLIC_KEY
JRELEASER_UPLOAD_SSH_${name}_PUBLIC_KEY
JRELEASER_UPLOAD_SFTP_PUBLIC_KEY
JRELEASER_UPLOAD_SSH_PUBLIC_KEY
JRELEASER_SFTP_${name}_PUBLIC_KEY
JRELEASER_SSH_${name}_PUBLIC_KEY
JRELEASER_SFTP_PUBLIC_KEY
JRELEASER_SSH_PUBLIC_KEY

privateKey

jreleaser.upload.sftp.${name}.private.key
jreleaser.upload.ssh.${name}.private.key
jreleaser.upload.sftp.private.key
jreleaser.upload.ssh.private.key
jreleaser.sftp.${name}.private.key
jreleaser.ssh.${name}.private.key
jreleaser.sftp.private.key
jreleaser.ssh.private.key

JRELEASER_UPLOAD_SFTP_${name}_PRIVATE_KEY
JRELEASER_UPLOAD_SSH_${name}_PRIVATE_KEY
JRELEASER_UPLOAD_SFTP_PRIVATE_KEY
JRELEASER_UPLOAD_SSH_PRIVATE_KEY
JRELEASER_SFTP_${name}_PRIVATE_KEY
JRELEASER_SSH_${name}_PRIVATE_KEY
JRELEASER_SFTP_PRIVATE_KEY
JRELEASER_SSH_PRIVATE_KEY

passphrase

jreleaser.upload.sftp.${name}.passphrase
jreleaser.upload.ssh.${name}.passphrase
jreleaser.upload.sftp.passphrase
jreleaser.upload.ssh.passphrase
jreleaser.sftp.${name}.passphrase
jreleaser.ssh.${name}.passphrase
jreleaser.sftp.passphrase
jreleaser.ssh.passphrase

JRELEASER_UPLOAD_SFTP_${name}_PASSPHRASE
JRELEASER_UPLOAD_SSH_${name}_PASSPHRASE
JRELEASER_UPLOAD_SFTP_PASSPHRASE
JRELEASER_UPLOAD_SSH_PASSPHRASE
JRELEASER_SFTP_${name}_PASSPHRASE
JRELEASER_SSH_${name}_PASSPHRASE
JRELEASER_SFTP_PASSPHRASE
JRELEASER_SSH_PASSPHRASE

fingerprint

jreleaser.upload.sftp.${name}.fingerprint
jreleaser.upload.ssh.${name}.fingerprint
jreleaser.upload.sftp.fingerprint
jreleaser.upload.ssh.fingerprint
jreleaser.sftp.${name}.fingerprint
jreleaser.ssh.${name}.fingerprint
jreleaser.sftp.fingerprint
jreleaser.ssh.fingerprint

JRELEASER_UPLOAD_SFTP_${name}_FINGERPRINT
JRELEASER_UPLOAD_SSH_${name}_FINGERPRINT
JRELEASER_UPLOAD_SFTP_FINGERPRINT
JRELEASER_UPLOAD_SSH_FINGERPRINT
JRELEASER_SFTP_${name}_FINGERPRINT
JRELEASER_SSH_${name}_FINGERPRINT
JRELEASER_SFTP_FINGERPRINT
JRELEASER_SSH_FINGERPRINT

Substitute ${name} for the value of the named instance.

Space (' '), underscore (_), and dash (-) will be replaced by dot (.) to separate tokens in the System property. Space (' '), dash (-), and dot (.) will be replaced by underscore (_) to separate tokens in the environment variable, such that:

${name} System Property Environment Variable

foobar

foobar

FOOBAR

fooBar

foobar

FOOBAR

foo bar

foo.bar

FOO_BAR

foo-bar

foo.bar

FOO_BAR

foo_bar

foo.bar

FOO_BAR

foo.bar

foo.bar

FOO_BAR

Path

The path where artifacts will be uploaded to.

An example configuration may look like path: '/uploads/{{projectName}}/{{tagName}}/{{artifactFile}}'.

And will result in a final deployment like /uploads/app/v1.0.0/app-1.0.0.zip.

DownloadUrl

The downloadUrl is the URL used to download artifacts from. This property is optional but should be set if artifacts are available for download.

An example configuration may look like downloadUrl: 'https://artifacts.acme.com:8081/upload/{{projectName}}/{{tagName}}/{{artifactFile}}'.

And will result in a final URL like https://artifacts.acme.com:8081/upload/app/v1.0.0/app-1.0.0.zip.

Skip Upload

Distributions and Artifacts may define extra properties that may stop them from being uploaded. These properties must conform to the following rules:

  • skipUpload: skipped from all uploaders.

  • skipUpload<type>: skipped from the typed uploader.

  • skipUpload<type><name>: skipped from the typed and named uploader.

Where <type> resolves to Sftp and <name> resolves to the capitalized name of the sftp instance, such that:

  • if the name is foo the resulting property key is skipUploadSftpFoo.

  • if the name is fooBar the resulting property key is skipUploadSftpFooBar.

  • if the name is foo-bar the resulting property key is skipUploadSftpFooBar.