Search in sources :

Example 26 with SCMSource

use of jenkins.scm.api.SCMSource in project gitlab-branch-source-plugin by Argelbargel.

the class GitLabSCMItemListener method updateProperties.

private boolean updateProperties(Job<?, ?> job, SCMSourceOwner sourceOwner, String sourceId) {
    SCMSource source = sourceOwner.getSCMSource(sourceId);
    if (source instanceof GitLabSCMSource) {
        String connectionName = ((GitLabSCMSource) source).getSourceSettings().getConnectionName();
        GitLabConnectionProperty property = job.getProperty(GitLabConnectionProperty.class);
        if (property == null || !connectionName.equals(property.getGitLabConnection())) {
            updateProperties(job, connectionName);
            return true;
        }
    }
    return false;
}
Also used : GitLabConnectionProperty(com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty) SCMSource(jenkins.scm.api.SCMSource)

Aggregations

SCMSource (jenkins.scm.api.SCMSource)26 BranchSource (jenkins.branch.BranchSource)25 GitSCMSource (jenkins.plugins.git.GitSCMSource)25 WorkflowMultiBranchProject (org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject)25 Test (org.junit.Test)23 Map (java.util.Map)22 DefaultBranchPropertyStrategy (jenkins.branch.DefaultBranchPropertyStrategy)22 ImmutableMap (com.google.common.collect.ImmutableMap)21 WorkflowJob (org.jenkinsci.plugins.workflow.job.WorkflowJob)17 List (java.util.List)11 ImmutableList (com.google.common.collect.ImmutableList)10 ArrayList (java.util.ArrayList)9 WorkflowRun (org.jenkinsci.plugins.workflow.job.WorkflowRun)7 MockFolder (org.jvnet.hudson.test.MockFolder)4 FreeStyleProject (hudson.model.FreeStyleProject)3 Queue (hudson.model.Queue)2 RunList (hudson.util.RunList)2 FlowNode (org.jenkinsci.plugins.workflow.graph.FlowNode)2 GitLabConnectionProperty (com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty)1 BuildData (hudson.plugins.git.util.BuildData)1