3

The Jenkins pipeline job looks like: Need to hide 'releaseTag'

The partial Jenkinsfile(we use scripted pipeline) is:

properties([parameters([string(defaultValue: "", description: "List of components", name: 'componentsToUpdate'),
                        string(defaultValue: "refs%2Fheads%2Fproject%2Fintegration", description: "BuildInfo CommitID", name: 'commitId'),
                        string(defaultValue: "", description: "Tag to release, e.g. 1.1.0-integration", name: 'releaseTag'),
                        string(defaultValue: "", description: "Forked buildInfo repo. Be aware right commit ID!!!", name: 'fork')]),
                        [$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '5']],
                        disableConcurrentBuilds()])
.
.
.

I wish to hide the 'releaseTag' parameter. The 'Hidden Parameter' plugin seems to be obsolete and I don't wish to use it. I referred to this thread which talks about passing the parameter within some hidden tag but when I referred to Jenkins pipeline documentation parameter syntax, I didn't find anything relevant to hiding a parameter.

How shall I proceed.

Note: I am a Jenkins beginner :)

Kaliyug Antagonist
  • 3,512
  • 9
  • 51
  • 103
  • Do you wish to hide the parameter because you wish to keep it static? or that you only want it set by other pipelines, and not when people manually run the job? – Jeff Dec 14 '18 at 13:43

1 Answers1

1

It looks like been while but in case you are still looking for answer. You may use https://plugins.jenkins.io/extended-choice-parameter/ plugin.

This plugin has hidden option, so with this way you can hide some of the your parameters.

You can use in pipeline like;

extendedChoice defaultValue: 'test', description: '', name: 'hiddenParameter', 'PT_HIDDEN', value: 'test,test2'
merdincz
  • 427
  • 4
  • 16