72 lines
1.6 KiB
Kotlin
72 lines
1.6 KiB
Kotlin
package examples
|
|
|
|
import templates.PhpDockerBuildTemplate
|
|
|
|
/**
|
|
* Example: How to use PhpDockerBuildTemplate in your project
|
|
*
|
|
* In your project's .teamcity/settings.kts:
|
|
*
|
|
* ```kotlin
|
|
* import jetbrains.buildServer.configs.kotlin.*
|
|
* import templates.PhpDockerBuildTemplate
|
|
*
|
|
* version = "2024.07"
|
|
*
|
|
* project {
|
|
* buildType(Build)
|
|
* }
|
|
*
|
|
* object Build : PhpDockerBuildTemplate({
|
|
* backendDir = "backend"
|
|
* enableCs = true
|
|
* enableAnalyse = true
|
|
* composerAuth = """
|
|
* {
|
|
* "http-basic": {
|
|
* "nexus.dot-dot.ru": {
|
|
* "username": "%env.NEXUS_USER%",
|
|
* "password": "%env.NEXUS_PASSWORD%"
|
|
* }
|
|
* }
|
|
* }
|
|
* """.trimIndent()
|
|
* })
|
|
* ```
|
|
*/
|
|
object ExamplePhpBuild : PhpDockerBuildTemplate({
|
|
// Registry settings
|
|
registry = "registry.dot-dot.ru"
|
|
dockerRegistryId = "PROJECT_EXT_2"
|
|
|
|
// PHP settings
|
|
backendDir = "backend"
|
|
enableCs = true
|
|
enableAnalyse = true
|
|
|
|
// Composer auth for private packages
|
|
composerAuth = """
|
|
{
|
|
"http-basic": {
|
|
"nexus.dot-dot.ru": {
|
|
"username": "ddadmin",
|
|
"password": "secret"
|
|
}
|
|
}
|
|
}
|
|
""".trimIndent()
|
|
|
|
// Docker settings
|
|
dockerfile = "Dockerfile"
|
|
tag = "%teamcity.build.branch%"
|
|
nexusHost = "nexus.dot-dot.ru"
|
|
nexusIp = "192.168.100.110"
|
|
|
|
// Gitea settings
|
|
giteaUrl = "https://gitea.dot-dot.ru/api/v1"
|
|
giteaTokenId = "credentialsJSON:gitea-token"
|
|
|
|
// Triggers
|
|
enableVcsTrigger = true
|
|
})
|