Re: Artifactory dsl code is not loading target repository in the configuration.

596 views
Skip to first unread message
Message has been deleted

Daniel Spilker

unread,
Jun 14, 2016, 4:36:19 PM6/14/16
to job-dsl...@googlegroups.com
You need to configure the Artifactoy server in the global settings (Manage Jenkins -> Configure system).

Daniel

On Sun, Jun 5, 2016 at 10:51 PM, Praveen A <arikathot...@gmail.com> wrote:
Hello All,

I am using job dsl plugin 1.47 and artifactory plugin 2.4.7 in jenkins.
I am getting error while running the build job with the generic artifactory configuration. Here is the error log. I have configured the artifactory server in global configuration.

Jenkins Artifactory Plugin version: 2.4.7
No Artifactory server configured for http://<ip>:<port>/artifactory. Please check your configuration.
FATAL: No Artifactory server configured for http://<ip>:<port>/artifactory. Please check your configuration.
java.io.IOException: No Artifactory server configured for http://52.87.22.160:8081/artifactory. Please check your configuration. at org.jfrog.hudson.util.RepositoriesUtils.validateServerConfig(RepositoriesUtils.java:186) at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator.setUp(ArtifactoryGenericConfigurator.java:271) at hudson.model.Build$BuildExecution.doRun(Build.java:156) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Skipped archiving because build is not successful Finished: FAILURE


Here is the code that I used in the dsl scripts.

job('gen-artifactory-config') {
  wrappers {
    artifactoryGenericConfigurator {
      details {
        artifactoryName('-XXXXXXXXX@XXXXXXXXXXX')
        artifactoryUrl('http://<ip>:<port>/artifactory')
        deployReleaseRepository {
          keyFromText('libs-snapshot-local')
          keyFromSelect('libs-snapshot-local')
          dynamicMode(false)
        }
        deploySnapshotRepository(null)
        resolveReleaseRepository(null)
        resolveSnapshotRepository(null)
        userPluginKey(null)
        userPluginParams(null)
      }
      resolverDetails(null)
      deployerCredentialsConfig{
        	username('admin')
            password('cGFzc3dvcmQ=')
        overridingCredentials(true)
        credentialsId('')
      }
      resolverCredentialsConfig(null)
      deployPattern('')
      resolvePattern('')
      matrixParams('')
      deployBuildInfo(true)
      includeEnvVars(false)
      envVarsPatterns {
        includePatterns('')
        excludePatterns('')
      }
      discardOldBuilds(true)
      discardBuildArtifacts(true)
      multiConfProject(false)
      artifactoryCombinationFilter('')
    }
    steps {
        maven('-e clean install deploy', 'pom.xml')
    }
    publishers {
        archiveArtifacts {
            pattern('target/*.war')
            onlyIfSuccessful()
        }
    }
  }
}

Please help me out on this.

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugi...@googlegroups.com.
To post to this group, send email to job-dsl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/004013ac-ef07-4d4b-96e8-ad774f7cf1f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Daniel Spilker

unread,
Jun 16, 2016, 2:50:02 AM6/16/16
to job-dsl...@googlegroups.com
Yes, that seems to be correct. Using the server name should be sufficient but it isn't. Job DSL only uses the configuration options provided by plugins. This needs to be fixed in the Artifactory plugin.

Daniel

On Wed, Jun 15, 2016 at 6:18 AM, Praveen A <arikathot...@gmail.com> wrote:
Thanks for the response daniel.

Sorry, I forgot to update that the issue is resolved by giving artifactory name and url same as follows. It was not working even after giving the artifactory details in global configuration. It worked after giving both name and url same in dsl code.

        artifactoryName('http://<ip>:<port>/artifactory')

artifactoryUrl('http://<ip>:<port>/artifactory')

Correct me if I'm wrong. By seeing the following snippet, it is returning the artifactory server only if artifactory name and url are same. That is why even after configuring artifactory in global configuration, getting the issue still.

public static ArtifactoryServer getArtifactoryServer(String artifactoryIdentity, List<ArtifactoryServer> artifactoryServers) {
        if (artifactoryServers != null) {
            for (ArtifactoryServer server : artifactoryServers) {
                if (server.getUrl().equals(artifactoryIdentity) || server.getName().equals(artifactoryIdentity)) {
                    return server;
                }
            }
        }
        return null;
    }

--
Praveen
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages