2020-03-25 16:27:29 +02:00
|
|
|
import com.mkobit.jenkins.pipelines.http.AnonymousAuthentication
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
java
|
2020-03-26 16:04:42 +02:00
|
|
|
groovy
|
|
|
|
jacoco
|
2020-03-25 16:27:29 +02:00
|
|
|
id("com.mkobit.jenkins.pipelines.shared-library") version "0.10.1"
|
2020-03-26 16:04:42 +02:00
|
|
|
id("com.github.ben-manes.versions") version "0.28.0"
|
2023-07-15 15:08:03 +02:00
|
|
|
id("org.jenkins-ci.jpi") version "0.38.0" apply false
|
|
|
|
}
|
|
|
|
|
2024-02-13 18:29:25 +02:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
2023-07-15 15:08:03 +02:00
|
|
|
tasks {
|
|
|
|
|
|
|
|
register<org.jenkinsci.gradle.plugins.jpi.TestDependenciesTask>("resolveIntegrationTestDependencies") {
|
|
|
|
into {
|
|
|
|
val javaConvention = project.convention.getPlugin<JavaPluginConvention>()
|
|
|
|
File("${javaConvention.sourceSets.integrationTest.get().output.resourcesDir}/test-dependencies")
|
|
|
|
}
|
|
|
|
configuration = configurations.integrationTestRuntimeClasspath.get()
|
|
|
|
}
|
|
|
|
processIntegrationTestResources {
|
|
|
|
dependsOn("resolveIntegrationTestDependencies")
|
|
|
|
}
|
2020-03-25 16:27:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
2020-03-26 16:04:42 +02:00
|
|
|
val junitVersion = "5.6.1"
|
|
|
|
val spockVersion = "1.3-groovy-2.4"
|
|
|
|
val groovyVersion = "2.4.19"
|
|
|
|
val slf4jVersion = "1.8.0-beta4"
|
2020-03-27 16:23:59 +02:00
|
|
|
var jacksonVersion = "2.9.8"
|
2020-03-26 16:04:42 +02:00
|
|
|
|
2020-03-25 16:27:29 +02:00
|
|
|
dependencies {
|
2020-03-26 16:04:42 +02:00
|
|
|
implementation("org.codehaus.groovy", "groovy-all", groovyVersion)
|
|
|
|
|
2020-03-27 16:23:59 +02:00
|
|
|
// jackson
|
|
|
|
implementation("com.fasterxml.jackson.module", "jackson-module-jsonSchema", jacksonVersion)
|
|
|
|
|
|
|
|
// unit-tests
|
2020-03-26 16:04:42 +02:00
|
|
|
testImplementation("org.junit.jupiter", "junit-jupiter-api", junitVersion)
|
|
|
|
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", junitVersion)
|
|
|
|
|
|
|
|
testImplementation("org.assertj", "assertj-core", "3.15.0")
|
|
|
|
testImplementation("org.mockito", "mockito-core", "3.3.3")
|
|
|
|
|
2020-03-27 16:23:59 +02:00
|
|
|
testImplementation("org.slf4j", "slf4j-api", slf4jVersion)
|
|
|
|
testImplementation("org.slf4j", "slf4j-simple", slf4jVersion)
|
2024-01-19 14:21:41 +02:00
|
|
|
|
2020-03-27 16:23:59 +02:00
|
|
|
// integration-tests
|
2020-03-26 16:04:42 +02:00
|
|
|
integrationTestImplementation("org.spockframework", "spock-core", spockVersion)
|
|
|
|
integrationTestImplementation("org.codehaus.groovy", "groovy-all", groovyVersion)
|
|
|
|
|
2023-06-03 16:35:00 +02:00
|
|
|
integrationTestImplementation("org.springframework.security", "spring-security-core", "5.1.13.RELEASE")
|
|
|
|
|
2020-03-26 16:04:42 +02:00
|
|
|
integrationTestImplementation("org.slf4j", "slf4j-api", slf4jVersion)
|
|
|
|
integrationTestImplementation("org.slf4j", "slf4j-simple", slf4jVersion)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
|
|
|
testLogging {
|
|
|
|
events("passed", "skipped", "failed")
|
|
|
|
}
|
|
|
|
|
|
|
|
reports {
|
|
|
|
html.isEnabled = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.check {
|
|
|
|
dependsOn(tasks.jacocoTestReport)
|
|
|
|
dependsOn(tasks.integrationTest)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.jacocoTestReport {
|
|
|
|
reports {
|
|
|
|
xml.isEnabled = true
|
|
|
|
xml.destination = File("$buildDir/reports/jacoco/test/jacoco.xml")
|
|
|
|
}
|
2020-03-25 16:27:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
jenkinsIntegration {
|
|
|
|
baseUrl.set(uri("http://localhost:5050").toURL())
|
|
|
|
authentication.set(providers.provider { AnonymousAuthentication })
|
|
|
|
downloadDirectory.set(layout.projectDirectory.dir("jenkinsResources"))
|
|
|
|
}
|
|
|
|
|
|
|
|
sharedLibrary {
|
|
|
|
// TODO: this will need to be altered when auto-mapping functionality is complete
|
|
|
|
coreVersion.set(jenkinsIntegration.downloadDirectory.file("core-version.txt").map { it.asFile.readText().trim() })
|
|
|
|
// TODO: retrieve downloaded plugin resource
|
|
|
|
pluginDependencies {
|
2020-03-26 16:04:42 +02:00
|
|
|
dependency("org.jenkins-ci.plugins", "pipeline-build-step", "2.12")
|
2021-06-11 16:17:02 +02:00
|
|
|
dependency("org.jenkins-ci.plugins", "pipeline-utility-steps", "2.8.0")
|
2020-10-26 16:54:59 +02:00
|
|
|
dependency("org.jenkins-ci.plugins", "git", "4.4.4")
|
2022-05-20 19:49:35 +02:00
|
|
|
dependency("org.jenkins-ci.plugins", "http_request", "1.15")
|
2020-03-26 16:04:42 +02:00
|
|
|
dependency("org.6wind.jenkins", "lockable-resources", "2.7")
|
2020-10-20 15:17:57 +02:00
|
|
|
dependency("ru.yandex.qatools.allure", "allure-jenkins-plugin", "2.28.1")
|
2020-03-26 16:04:42 +02:00
|
|
|
val declarativePluginsVersion = "1.6.0"
|
2020-03-25 16:27:29 +02:00
|
|
|
dependency("org.jenkinsci.plugins", "pipeline-model-api", declarativePluginsVersion)
|
|
|
|
dependency("org.jenkinsci.plugins", "pipeline-model-declarative-agent", "1.1.1")
|
|
|
|
dependency("org.jenkinsci.plugins", "pipeline-model-definition", declarativePluginsVersion)
|
|
|
|
dependency("org.jenkinsci.plugins", "pipeline-model-extensions", declarativePluginsVersion)
|
2022-05-20 19:49:35 +02:00
|
|
|
dependency("io.jenkins.blueocean", "blueocean-pipeline-api-impl", "1.25.3")
|
2024-02-13 14:07:44 +02:00
|
|
|
dependency("sp.sd", "file-operations", "214.v2e7dc7f25757")
|
2020-03-25 16:27:29 +02:00
|
|
|
}
|
|
|
|
}
|