Skip to content

Explicit Documentation for discerning if value is supplied #248

@kshenk1

Description

@kshenk1

Describe your use-case which is not covered by existing documentation.

If I create a Stashed file parameter named "my_file", and after choosing "Build with Parameters" the parameter params.my_file is null. This is unexpected as we're typically validating parameters by accessing them this way.

Through internal conversation I've learned that (in this particular case) my_file_FILENAME will be unset if the file is missing. It would be good to mention this in the documentation explicitly, as the build will happily continue without providing a file.

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

https://plugins.jenkins.io/file-parameters/

Accessing original upload filename

Original filename will be stored in evironment in <parameter_name>_FILENAME variable - assuming parameter is named FILE, snippet below will give you file with original filename in current workspace:

node {
  unstash 'FILE'
  sh 'mv FILE $FILE_FILENAME'
}

Potentially related to: #26 as a feature.
Also related: #217

It's kinda there, but not quite...

Are you interested in contributing to the documentation?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions