uk.co.codera.ci.tooling.jenkins.JenkinsJobCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codera-ci-tooling-service-jenkins Show documentation
Show all versions of codera-ci-tooling-service-jenkins Show documentation
Provides integration with jenkins such as creating and deleting jobs automatically.
The newest version!
package uk.co.codera.ci.tooling.jenkins;
import uk.co.codera.ci.tooling.scm.ScmEvent;
import uk.co.codera.ci.tooling.scm.ScmEventListener;
import uk.co.codera.ci.tooling.template.TemplateService;
public class JenkinsJobCreator implements ScmEventListener {
private final TemplateService jobNameFactory;
private final TemplateService jobFactory;
private final JenkinsService jenkinsService;
public JenkinsJobCreator(TemplateService jobNameFactory, TemplateService jobFactory, JenkinsService jenkinsService) {
this.jobNameFactory = jobNameFactory;
this.jobFactory = jobFactory;
this.jenkinsService = jenkinsService;
}
@Override
public void on(ScmEvent event) {
String jobName = this.jobNameFactory.create(event);
String jobDefinition = this.jobFactory.create(event);
this.jenkinsService.createJob(jobName, jobDefinition);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy