Package-level declarations

Types

Link copied to clipboard
data class JenkinsBuild(val result: String, val number: Int, val url: String?, val timestamp: Long)

Represents a Jenkins build.

Link copied to clipboard
data class JenkinsConfig(val url: String, val username: String, val token: String)

The Jenkins configuration.

Link copied to clipboard
data class JenkinsJob(val name: String, val url: String?, val description: String?, val lastBuild: JenkinsBuild?, val lastCompletedBuild: JenkinsBuild?, val lastFailedBuild: JenkinsBuild?, val lastStableBuild: JenkinsBuild?)

Represents a Jenkins job.

Properties

Link copied to clipboard

The JenkinsConfig instance.

Link copied to clipboard

The Jenkins Credentials Description for the Nexus Credentials.

Link copied to clipboard

The Jenkins Credentials ID for the Nexus Credentials.

Functions

Link copied to clipboard
fun changeJenkinsPassword(username: String, newPassword: String): Boolean

Changes the Jenkins password for a user.

Link copied to clipboard
fun checkCredentials(username: String, password: String)

Checks if the Jenkins credentials exist, and creates them if they don't.

Link copied to clipboard

Checks the user config.xml present on the Jenkins CI.

Link copied to clipboard
fun createJenkinsJob(username: String, jobName: String, repoLink: String, isFreestyle: Boolean, config: (String) -> String = { it }): Boolean

Creates a Jenkins job.

Link copied to clipboard
fun createJenkinsUser(username: String, password: String, group: Boolean = false): Boolean

Creates a Jenkins user.

Link copied to clipboard
fun deleteJob(username: String, jobName: String): Boolean

Deletes a Jenkins job.

Link copied to clipboard
fun deleteUser(username: String): Boolean

Deletes a Jenkins user.

Link copied to clipboard

Gets all Jenkins users.

Link copied to clipboard
fun getJenkinsUser(username: String): String

Gets a Jenkins user's configuration.

Link copied to clipboard
fun getJobInfo(username: String, jobName: String): JenkinsJob?

Gets the information of a Jenkins job.

Link copied to clipboard

Checks if a Git repository is a freestyle project.

Link copied to clipboard
suspend fun jenkins(url: String, request: HttpRequest.Builder.() -> Unit = { GET() }): HttpResponse<String>

Sends an HTTP request using the JenkinsConfig.authorization header.

Link copied to clipboard
fun ping(): Boolean

Pings the Jenkins server.

Link copied to clipboard
fun triggerBuild(username: String, jobName: String): Boolean

Triggers a build for a Jenkins job.