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

Declarative Pipeline: dir() inside a step problem

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline
    • Jenkins 2.138.2; Windows Server 2012R2

      I am trying to refactor a step in my pipeline.  Currently I have this stage:

       

      stage('Deploy') {
       steps {
       echo 'Deploying....'
       //dir('$SQLPROJDIR\\bin\\Output') {
       bat "$SQLPACKAGE /action:publish " + 
       "/sourcefile:$SQLPROJDIR\\bin\\Output\\Vision.dacpac " + 
       "/profile:$SQLPROJDIR\\bin\\Output\\Vision.dev.publish.xml " +
       "/targetdatabasename:Vision_develop " 
       //}
      }}

      which works fine and runs about 5 min.  I want to factor out the directory refs by wrapping the bat call inside a dir(){}, but when I uncomment the call to dir (and the matching end brace, the deployment never finishes and I do not see any of the many messages that the deployment issues to the console.

            Unassigned Unassigned
            gbritton Gerald Britton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: