jenkins-rest-api

Jenkins Java Rest API

License

License

Categories

Categories

Jenkins Build Tools Continuous Integration and Continuous Delivery
GroupId

GroupId

com.github.jojoldu
ArtifactId

ArtifactId

jenkins-rest-api
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

jenkins-rest-api
Jenkins Java Rest API
Project URL

Project URL

https://github.com/jojoldu/jenkins-rest-api
Source Code Management

Source Code Management

https://github.com/jojoldu/jenkins-rest-api

Download jenkins-rest-api

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jojoldu/jenkins-rest-api/ -->
<dependency>
    <groupId>com.github.jojoldu</groupId>
    <artifactId>jenkins-rest-api</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jojoldu/jenkins-rest-api/
implementation 'com.github.jojoldu:jenkins-rest-api:0.0.1'
// https://jarcasting.com/artifacts/com.github.jojoldu/jenkins-rest-api/
implementation ("com.github.jojoldu:jenkins-rest-api:0.0.1")
'com.github.jojoldu:jenkins-rest-api:jar:0.0.1'
<dependency org="com.github.jojoldu" name="jenkins-rest-api" rev="0.0.1">
  <artifact name="jenkins-rest-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jojoldu', module='jenkins-rest-api', version='0.0.1')
)
libraryDependencies += "com.github.jojoldu" % "jenkins-rest-api" % "0.0.1"
[com.github.jojoldu/jenkins-rest-api "0.0.1"]

Dependencies

compile (4)

Group / Artifact Type Version
org.glassfish.jersey.core : jersey-client jar 2.25.1
org.glassfish.jersey.media : jersey-media-json-jackson jar 2.25.1
commons-codec : commons-codec jar 1.10
org.apache.commons : commons-lang3 jar 3.5

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.16.18

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 3.8.0

Project Modules

There are no modules declared in this project.

jenkins-rest-api

Jenkins Java Rest API Module

목적

특정 비지니스 로직 사이에 젠킨스 Job을 사용해야할때가 있습니다.
어플리케이션에서 젠킨스 Job을 구동시킬수 있는 모듈입니다.

사용방법

주의사항

혹시나 403이 발생하는 분들은 젠킨스의 CORS 문제때문입니다.
젠킨스의 Global Security에서 CORS 체크박스를 해제해야만 사용가능합니다.

cors

Job Parameter 없을 경우

RequestEntity requestEntity = new RequestEntity(HOST, JOB, USERNAME, TOKEN);
JenkinsConnector jenkinsConnector = new JenkinsConnector();

jenkinsConnector.executeJob(requestEntity);

Job Parameter 있을 경우

RequestEntity requestEntity = new RequestEntity(HOST, JOB, USERNAME, TOKEN);
requestEntity.add(new NameValue("name", "jojoldu"));
requestEntity.add(new NameValue("email", "[email protected]"));

JenkinsConnector jenkinsConnector = new JenkinsConnector();

jenkinsConnector.executeJob(requestEntity);

JenkinsConnector의 경우 Bean으로 등록하여 사용하면 더 효과적

Versions

Version
0.0.1