-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
Jenkins:
- Core 2.76
- Ubuntu 15.04
- Pipeline plugins:
- pipeline-graph-analysis 1.5
- pipeline-rest-api 2.8 (2.9)
- pipeline-model-definition 1.2-beta-4
- pipeline-model-api 1.2-beta-4
- pipeline-stage-view 2.8 (2.9)
- blueocean-pipeline-editor 1.2.0
- pipeline-input-step 2.8
- blueocean-github-pipeline 1.2.0
- pipeline-stage-tags-metadata 1.2-beta-4
- pipeline-model-declarative-agent 1.1.1
- pipeline-model-extensions 1.2-beta-4
- blueocean-pipeline-api-impl 1.2.0
- blueocean-pipeline-scm-api 1.2.0
- pipeline-stage-step 2.2
- pipeline-build-step 2.5.1
- blueocean-git-pipeline 1.2.0
- blueocean-bitbucket-pipeline 1.2.0
- pipeline-milestone-step 1.3.1
- pipeline-github-lib 1.0
Agent:
- OS: Amazon Linux AMI VERSION="2017.03"
- Java: openjdk version "1.8.0_141"
Client:
- Fedora Workstation 26
- Google Chrome 60.0.3112.113 (Official Build) (64-bit)Jenkins: - Core 2.76 - Ubuntu 15.04 - Pipeline plugins: - pipeline-graph-analysis 1.5 - pipeline-rest-api 2.8 (2.9) - pipeline-model-definition 1.2-beta-4 - pipeline-model-api 1.2-beta-4 - pipeline-stage-view 2.8 (2.9) - blueocean-pipeline-editor 1.2.0 - pipeline-input-step 2.8 - blueocean-github-pipeline 1.2.0 - pipeline-stage-tags-metadata 1.2-beta-4 - pipeline-model-declarative-agent 1.1.1 - pipeline-model-extensions 1.2-beta-4 - blueocean-pipeline-api-impl 1.2.0 - blueocean-pipeline-scm-api 1.2.0 - pipeline-stage-step 2.2 - pipeline-build-step 2.5.1 - blueocean-git-pipeline 1.2.0 - blueocean-bitbucket-pipeline 1.2.0 - pipeline-milestone-step 1.3.1 - pipeline-github-lib 1.0 Agent: - OS: Amazon Linux AMI VERSION="2017.03" - Java: openjdk version "1.8.0_141" Client: - Fedora Workstation 26 - Google Chrome 60.0.3112.113 (Official Build) (64-bit)
-
-
Declarative - 1.2
Summary:
The first time a declarative pipeline which makes use of parameters gets run, the link in the Jenkins UI says "Build." This appears to cause the build to run without processing the parameters { } block at all.
Steps to recreate:
1. Create a simple Pipeline job in Jenkins, and paste this into it:
pipeline { parameters { string(name: 'AGENT_NAME', defaultValue: 'linux', description: 'Where to run') } agent { label ("${env.AGENT_NAME}") } options { buildDiscarder(logRotator(numToKeepStr: '100')) disableConcurrentBuilds() timestamps() } stages { stage ('Parallel Wrapper') { steps { sh 'java -version' } } // end stage } // end stages post { always { echo "ALWAYS --> Runs all the time." } success { echo "SUCCESS --> Whatever we did, it worked. Yay!" } failure { echo "FAILURE --> Failed. Womp womp." } } }
2. Save the Pipeline, but don't run it yet. Look on the left: the link to start a build says "Build Now." Like this:
3. Click "Build Now,"
4. Navigate to the console log for the build you just started. Pretty soon, you'll see this:
Started by user admin [Pipeline] node Still waiting to schedule task There are no nodes with the label ‘null’
5. I first thought that this was a bug in my Pipeline code, but it's not. Navigate back to the main page for the Pipeline, and look at that Build link again. Notice that it now says "Build with Parameters"
6. Run the build a second time by clicking "Build with parameters." This time, you'll be prompted to provide, or verify, the AGENT_NAME parameter:
That's why I'm convinced that the parameters section just isn't being processed at all on first run. I've got a default setting in place, and that default setting will work. But not that first time.
7. After you've done your second attempt, you might end up here. In which case, you'll need to cancel the still-queued Build #1:
- duplicates
-
JENKINS-41929 Offer "Build with Parameters" on first build when declarative Jenkinsfile found
- Open