job-dsl plugin and Artifactory plugin

16 views
Skip to first unread message

ctc...@gmail.com

unread,
Oct 8, 2017, 4:35:39 AM10/8/17
to job-dsl-plugin
Hi,

I have a groovy script run from a DSL seed job, which creates jobs using the job-dsl job() API call. Is it possible to include calls into the Artifactory plugin in jobs created like this.
I'd like to include code similar to this example https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Artifactory+Plugin+-+Setting+Up+Docker+Build+Info#JenkinsArtifactoryPlugin-SettingUpDockerBuildInfo-TestYourSetup which uses the Pipeline plugin:


    def server = Artifactory.server '<ArtifactoryServerID>'
   
def artDocker= Artifactory.docker username: '<username>', password: '<password>'
   
// Or if the docker daemon is configured to use a TCP connection:
   
// def artDocker= Artifactory.docker username: '<username>', password: '<password>', host: "tcp://<docker daemon host>:<docker daemon port>"
   
// If your agent is running on OSX:
   
// def artDocker= Artifactory.docker username: '<username>', password: '<password>', host: "tcp://127.0.0.1:1234"
   
def dockerInfo = artDocker.push '<artifactoryDockerRegistry>/hello-world:latest', '<targetRepo>'
    server
.publishBuildInfo(dockerInfo)




Chris
Reply all
Reply to author
Forward
0 new messages