Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21053

Incorrect passing of arguments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • ant-plugin
    • None
    • CentOS 6.5 x86_64
      Oracle Java jdk 1.6.0_31
      Ant 1.8.3
      Jenkins installed from RPM

      One of our builds uses this command within Jenkins:

      SVN_SRC="svn://svn.usdataworks.com/Repository/$location"; DATE_STR=`date +%Y%m%d-%H%M%S`; SVN_DST="$DATE_STR-$label"; mkdir /usdataworks/dev/$DATE_STR; PATH=.:$PATH udwBuild.sh -c $SVN_SRC -p -r -v $label -t $SVN_DST -j $JAVA_HOME -D "-DkeyStore=../../../../../../../../var/lib/jenkins/.jks/myclearingworks.jks -DkeyAlias=\"key from secure.instantssl.com\" -Dstorepass=<redacted> -Dkeypass=<redacted>" /usdataworks/dev/$DATE_STR; rm -rf /usdataworks/dev/$DATE_STR

      However, an strace shows that by the time ant is called, "-DkeyStore..." has been stripped of the -D, so that ant interprets the remaining "keyStore..." as an ant target and the build fails because that target isn't defined.

      The ant command ends up being:

      5590 execve("/opt/apache-ant-1.8.3/bin/ant", ["ant", "-Dversion.label.core=3.7.1_rc12", "keyStore=../../../../var/lib/jenkins/.jks/myclearingworks.jks", "-DkeyAlias=\\\"key", "from", "secure.instantssl.com\\\"", "-Dstorepass=<redacted>", "-Dkeypass=<redacted>", "clean", "build"], [/* 39 vars */]) = 0

      We also noticed that, in Jenkins' console output, the command line was shown as:

      udwBuildApp.sh -p svn://svn.usdataworks.com/Repository/tags/3.6.2.FP1 -a svn://svn.usdataworks.com/Applications/ConfigurationReplicator/trunk -v 0.0.9 -j svn://svn.usdataworks.com/Applications/ConfigurationReplicator/branches/ReleaseCandidates -D '-DkeyStore=../../../../../../../../var/lib/jenkins/.jks/myclearingworks.jks -DkeyAlias="key from secure.instantssl.com" -Dstorepass=<redacted> -Dkeypass=<redacted>'

      In addition to losing the -D in front of keyStore, it looks like Jenkins converted the double quotes we actually typed into single quotes?

            Unassigned Unassigned
            usdataworks_eanderson Edgar Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: