#347 ✓duplicate
Charles Scott

api -vs- jobref , default parameter values not consistent

Reported by Charles Scott | June 21st, 2011 @ 01:00 PM

I am describing behavior that does not appear consistent....

When calling a job from the rundeck plugin in jenkins, I have an explicitly passed parameter where two other parameters are implicitly set via defaults in rundeck job. This works as expected. When trying to call the same job via a higher level rundeck job using jobref, the default parameter values do not get expanded.

Inline are configuration for rundeck plugin in jenkins and jobxml that refers to another job that describes the problem.

Jenkins Plugin Config:

Here is my jenkins configuration with rundeck plugin that refers to a jobId where we see the explicit parameter:

<org.jenkinsci.plugins.rundeck.RundeckNotifier>
  <jobId>93</jobId>
  <options>package=zap-rundeck-jobs</options>
  <tag></tag>
  <shouldWaitForRundeckJob>true</shouldWaitForRundeckJob>
  <shouldFailTheBuild>true</shouldFailTheBuild>
</org.jenkinsci.plugins.rundeck.RundeckNotifier>

when build occurs it triggers job id 93

with desired results when tailing log in rundeck:

12:41:33 ciHost: dev-ctier1.acme.com:8180
12:41:33 package: zap-rundeck-jobs
12:41:33 archiveFile: archive.zip

All three parameters are expanded.

A reference to a same job using jobref (NOTE: this is using the non numeric reference of the same job above):


<id>117</id>
<loglevel>INFO</loglevel>
<sequence keepgoing='false' strategy='node-first'>
  <command>
    <jobref name='promote' group='zap/dev'>
      <arg line='-package ${option.package}' />
    </jobref>
  </command>
</sequence>
<description>promote zap package from the CI environment and deploy to the dev environment</description>
<name>promoteAndDeploy</name>
<context>
  <project>Acme</project>
  <options>
    <option required='true' name='package' enforcedvalues='true' valuesUrl='http://localhost/options/common/jenkins/jobs?username=build&amp;password=XXX&amp;ciHost=dev-ctier1.acme.com:8180' />
  </options>
</context>
<dispatch>
  <threadcount>1</threadcount>
  <keepgoing>false</keepgoing>
  <excludePrecedence>true</excludePrecedence>
</dispatch>
<nodefilters>
  <include>
    <tags>yum</tags>
  </include>
</nodefilters>
<group>zap/dev</group>

we see that the defaults are not expanded:

12:45:25 ciHost: option.ciHost
12:45:25 package: zap-rundeck-jobs
12:45:25 archiveFile: option.archiveFile

And just the explicitly passed parameter is interpreted properly.

And the job that is being called (jobId: 93 == zap/dev promote), which shows that parameters and desired default that should be populating.


<id>93</id>
<loglevel>INFO</loglevel>
<sequence keepgoing='false' strategy='node-first'>
  <command>
    <scriptargs />
    <script><![CDATA[#!/bin/bash

echo "ciHost: @option.ciHost@"
echo "package: @option.package@"
echo "archiveFile: @option.archiveFile@"
exit

]]>

  </command>
</sequence>
<description>promote zap packages from the CI environment</description>
<name>promote</name>
<context>
  <project>Acme</project>
  <options>
    <option required='true' name='archiveFile' enforcedvalues='true' values='archive.zip' value='archive.zip' />
    <option required='true' name='ciHost' enforcedvalues='true' values='dev-ctier1.acme.com:8180' value='dev-ctier1.acme.com:8180' />
    <option name='createRepo' enforcedvalues='true' values='false,true' value='true' />
    <option required='true' name='package' enforcedvalues='true' valuesUrl='http://localhost/options/common/jenkins/jobs?username=build&amp;password=5AbRab9phu&amp;ciHost=dev-ctier1.acme.com:8180' />
    <option required='true' name='yumDir' enforcedvalues='true' values='/data/yum/zap-repo' value='/data/yum/zap-repo' />
  </options>
</context>
<dispatch>
  <threadcount>1</threadcount>
  <keepgoing>false</keepgoing>
  <excludePrecedence>true</excludePrecedence>
</dispatch>
<nodefilters>
  <include>
    <tags>yum</tags>
  </include>
</nodefilters>
<group>zap/dev</group>

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues

Shared Ticket Bins

People watching this ticket

Tags

Pages