领先一步
VMware 提供培训和认证,助您加速进步。
了解更多我很高兴代表 Spring Cloud 团队宣布 Spring Cloud Pipelines 发布一个新的里程碑版本 - 1.0.0.M2。除了修复一些 bug 外,它还提供了对 Gradle 项目的开箱即用支持。
为了使 Gradle 项目能够开箱即用,我们做出以下一些约定俗成的决定:
使用 Gradlew Wrapper
使用自定义的 deploy 任务来部署构件
通过自定义的 smoke 任务运行已部署应用程序的冒烟测试
通过自定义的 e2e 任务运行已部署应用程序的端到端测试
自定义 groupId 任务以检索组 ID
自定义 artifactId 任务以检索构件 ID
自定义 currentVersion 任务以检索当前版本
自定义 stubIds 任务以检索应下载存根的协作者列表
这些任务的示例实现可以在这里找到。我们将其内容粘贴在下方
test {
description = "Task to run unit and integration tests"
testLogging {
exceptionFormat = 'full'
}
jvmArgs = systemPropsFromGradle()
exclude 'smoke/**'
exclude 'e2e/**'
}
task smoke(type: Test) {
description = "Task to run smoke tests"
testLogging {
exceptionFormat = 'full'
}
jvmArgs = systemPropsFromGradle()
include 'smoke/**'
}
task e2e(type: Test) {
description = "Task to run end to end tests"
testLogging {
exceptionFormat = 'full'
}
jvmArgs = systemPropsFromGradle()
include 'e2e/**'
}
task deploy(dependsOn: 'publish') {
description = "Abstraction over publishing artifacts to Artifactory / Nexus"
}
task groupId << {
println projectGroupId
}
groupId.description = "Task to retrieve Group ID"
task artifactId << {
println projectArtifactId
}
artifactId.description = "Task to retrieve Artifact ID"
task currentVersion << {
println projectVersion
}
currentVersion.description = "Task to retrieve version"
task stubIds << {
println stubrunnerIds
}
stubIds.description = "Task to retrieve Stub Runner IDS"
[test, smoke, e2e, deploy, groupId, artifactId, currentVersion, stubIds].each {
it.group = "Pipeline"
}
private List<String> systemPropsFromGradle() {
return project.gradle.startParameter.systemPropertiesArgs.entrySet().collect { "-D${it.key}=${it.value}" }
}
与大多数 Spring 项目不同,这个项目不提供任何库,因为它不是一个库,而是作为一个 GitHub 存储库提供,供您下载并用作创建部署管道的模板。
请查看以下任何链接以获取更多信息或与我们联系。