Details

    • Similar Issues:

      Description

      Currently, it only seems to be possible to create a scripted pipeline for Go projects with this plugin. I was struggling to find equivalent support for modeling a declarative pipeline.

      The issues I ran into:

      1. Accessing a tool in a declarative pipeline should work just fine.
      2. Defining a custom workspace is not allowed in a declarative pipeline.
      3. Setting the environment variables for different build stages is impractical. If possible those environment variables should already be preset.

      This is how I solved the issue right now, however, Jenkins seems to move away from scripted pipelines toward declarative ones. Let me know if this is already possible.

      node {
          def goHome = tool('go-1.11')
          
          ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/src/github.com/bmuschko/link-verifier") {
              withEnv(["GOROOT=${goHome}", "GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/", "PATH+GO=${goHome}/bin"]) {
              ...
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              bmuchko Benjamin Muschko
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: