Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-937

Support JFrog DSL from within Docker containers

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 2.12.2
    • Fix Version/s: 2.13.0
    • Component/s: Gradle, Maven3
    • Labels:
      None
    • Environment:

      Jenkins 2.32.3, Artifactory plugin 2.11.0, Pipeline 2.5

      Description

      How to run Jenkins pipeline jobs using JFrog DSL from within Docker containers?
      def buildenv = docker.image('container')
      buildenv.pull()
      buildenv.inside {
      def server = Artifactory.server('OLP Staging Artifactory')
      def buildInfo = Artifactory.newBuildInfo()
      buildInfo.env.capture = true

      stage('Build') {
      timeout(10)

      { def rtGradle = Artifactory.newGradleBuild() rtGradle.useWrapper = true rtGradle.resolver repo:'remote-repos', server: server rtGradle.run tasks: 'test jacocoTestReport' }

      }
      }
      will fail with: Could not read initialization script '/tmp/init-artifactory6638392993045452201gradle' as it does not exist.

      same code running on the plain slave will pass thru correctly. Docker containers are widely used in CD flows running on top of stateless nodes in the cloud.

        Attachments

          Activity

            People

            • Assignee:
              yahavi Yahav Itzhak
              Reporter:
              ldavid David Liederman
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: