在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):rodm/gradle-teamcity-plugin开源软件地址(OpenSource Url):https://github.com/rodm/gradle-teamcity-plugin开源编程语言(OpenSource Language):Groovy 55.4%开源软件介绍(OpenSource Introduction):Gradle TeamCity pluginThe plugin provides support for developing TeamCity plugins, creating agent and server side archives, publishing them to plugins portal, downloading and installing a TeamCity server and tasks to deploy, start and stop the server and agent. Supported Gradle and Java versionsBuilding the pluginTo build the plugin and run the unit tests run ./gradlew -s check To run the functional tests run ./gradlew -s functionalTest To test the samples run ./gradlew -s samplesTest Using the pluginApplying the plugins to a buildThe plugin archive published to the Gradle Plugin Portal contains five plugins:
Refer to the Gradle Plugin Portal for instructions on how to apply the server, agent, common, base and environments plugins. ConfigurationsThe plugins add the following configurations.
Extension PropertiesThe following properties are defined in the
TeamCity Base PluginApplying the base plugin allows the extension properties ExamplePlugin descriptor defined in the build script. teamcity {
version = '2021.2-SNAPSHOT'
allowSnapshotVersions = true // allow snapshot versions
validateBeanDefinition = "fail" // fail build on any plugin validation errors
defaultRepositories = true // use default repositories to resolve dependencies
} TeamCity Server PluginThe plugin when applied with the Java Plugin, adds the JetBrains Maven repository and adds the TeamCity The server plugin can be combined with the agent plugin in the same project but not with the Java Plugin. ConfigurationThe following properties can be defined in the
The plugin descriptor properties shown in the examples below and described in the TeamCity documentation for Server-Side Plugin Descriptor Tasks
The plugin enhances the ExamplesPlugin descriptor defined in the build script. teamcity {
// Use TeamCity 2018.1 API
version = '2018.1'
// Plugin descriptor
server {
descriptor {
// required properties
name = project.name
displayName = 'TeamCity Plugin'
version = project.version
vendorName = 'vendor name'
// optional properties
description = 'Example TeamCity plugin'
downloadUrl = 'download url'
email = '[email protected]'
vendorUrl = 'vendor url'
vendorLogo = 'vendor logo'
// deployment properties
useSeparateClassloader = true
allowRuntimeReload = true
nodeResponsibilitiesAware = true
// requirements properties
minimumBuild = '58245' // 2018.1
maximumBuild = '78938' // 2020.1.5
parameters {
parameter 'name1', 'value1'
parameter 'name2', 'value2'
}
dependencies {
plugin 'plugin1-name'
plugin 'plugin2-name'
tool 'tool1-name'
tool 'tool2-name'
}
}
web {
webpack // A task the runs webpack
// or
project.files("${buildDir}/frontend") // the contents of a directory
}
// Additional files can be included in the server plugin archive using the files configuration block
files {
into('tooldir') {
from('tooldir')
}
}
}
} The build numbers for the properties Plugin descriptor defined in an external file at the root of the project. A map of tokens to be replaced in the
descriptor file can be provided using the teamcity {
// Use TeamCity 2018.1 API
version = '2018.1'
server {
// Locate the plugin descriptor in the root directory of the project
descriptor = file('teamcity-plugin.xml')
tokens = [VERSION: project.version, VENDOR_NAME: 'vendor name']
}
} The following example uses the Kotlin DSL. build.gradle.kts
teamcity {
version = "2018.1"
server {
descriptor {
// required properties
name = project.name
displayName = "TeamCity Plugin"
version = project.version as String?
vendorName = "vendor name"
// optional properties
description = "Example TeamCity plugin"
downloadUrl = "download url"
email = "[email protected]"
vendorUrl = "vendor url"
vendorLogo = "vendor logo"
// deployment properties
useSeparateClassloader = true
allowRuntimeReload = true
nodeResponsibilitiesAware = true
// requirements properties
minimumBuild = "58245" // 2018.1
maximumBuild = "78938" // 2020.1.5
parameters {
parameter("name1", "value1")
parameter("name2", "value2")
}
dependencies {
plugin("plugin1-name")
plugin("plugin2-name")
tool("tool1-name")
tool("tool2-name")
}
}
web {
tasks.named("webpack") // A task the runs webpack
// or
project.files("${buildDir}/frontend") // the contents of a directory
}
files {
into("tooldir") {
from("tooldir")
}
}
}
} Signing a pluginThe build.gradle
teamcity {
server {
descriptor {
...
}
sign {
certificateFile = findProperty('ca.crt')
privateKeyFile = findProperty('private-key.file')
password = findProperty('private-key.password')
}
}
} Publishing a pluginThe The The following example configures the build.gradle
publishPlugin {
token = findProperty('jetbrains.token')
} The following example uses the Kotlin DSL. build.gradle.kts
tasks.withType<PublishPlugin> {
token = findProperty("jetbrains.token") as String?
} The token and other properties can also be configured in the build.gradle
teamcity {
server {
descriptor {
...
}
publish {
channels = ['Beta']
token = findProperty('jetbrains.token')
notes = 'change notes'
}
}
} It is recommended to store the credentials for the JetBrains Plugin Repository in TeamCity Agent PluginThe plugin when applied with the Java Plugin, adds the JetBrains Maven repository and adds the TeamCity ConfigurationThe following properties can be defined in the
The plugin descriptor properties are shown in the examples below and described in the TeamCity documentation for Agent-Side Plugin Descriptor Tasks
The plugin enhances the ExamplesAgent side plugin descriptor teamcity {
version = teamcityVersion
agent {
descriptor {
pluginDeployment {
useSeparateClassloader = false
executableFiles {
include 'file1'
include 'file2'
}
}
dependencies {
plugin 'plugin-name'
tool 'tool-name'
}
}
}
} Agent tool descriptor teamcity {
version = teamcityVersion
agent {
descriptor {
toolDeployment {
executableFiles {
include 'tooldir/file1'
include 'tooldir/file2'
}
}
dependencies {
plugin 'plugin-name'
tool 'tool-name'
}
}
// Additional files can be included in the agent plugin archive using the files configuration block
files {
into('tooldir') {
from('tooldir')
}
}
}
} The following example uses the Kotlin DSL. build.gradle.kts
val teamcityVersion by extra((findProperty("teamcity.api.version") ?: "2018.1") as String)
teamcity {
version = teamcityVersion
agent {
descriptor {
pluginDeployment {
useSeparateClassloader = false
executableFiles {
include("file1")
include("file2")
}
}
dependencies {
plugin("plugin-name")
tool("tool-name")
}
}
files {
into("tooldir") {
from("tooldir")
}
}
}
} TeamCity Environments PluginApplying this plugin provides tasks to download, install, start and stop a local TeamCity Server and Build Agent or start and stop a server or agent using Docker. This allows a plugin to be debugged or tested against multiple versions of TeamCity. ConfigurationThe The following properties can be defined in the
The following Gradle properties can be used to override the shared environment properties from the command line or by setting a value in a gradle.properties file.
The A Local TeamCity EnvironmentConfigurationTo configure a local TeamCity environment the configuration block supports the following properties
The following Gradle properties can be used to override the properties for a specific environment from
the command line or by setting a value in a gradle.properties file. Replace
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论