.bamboo.specs.extension.bamboo-specs-extension.1.2.6.source-code.EnvironmentExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bamboo-specs-extension Show documentation
Show all versions of bamboo-specs-extension Show documentation
A Kotlin DSL for Bamboo Specs
package com.atlassian.bamboo.specs.extension
import com.atlassian.bamboo.specs.api.builders.AtlassianModule
import com.atlassian.bamboo.specs.api.builders.deployment.Environment
import com.atlassian.bamboo.specs.api.builders.deployment.configuration.AnyPluginConfiguration
import com.atlassian.bamboo.specs.api.builders.deployment.configuration.EnvironmentPluginConfiguration
import com.atlassian.bamboo.specs.api.builders.notification.Notification
import com.atlassian.bamboo.specs.api.builders.notification.NotificationType
import com.atlassian.bamboo.specs.api.builders.task.AnyTask
import com.atlassian.bamboo.specs.api.builders.task.Task
import com.atlassian.bamboo.specs.api.builders.trigger.AnyTrigger
import com.atlassian.bamboo.specs.api.builders.trigger.Trigger
fun > Environment.task(constructor: () -> T, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
val task = taskInitialisation(constructor, description, enabled, init)
this.tasks(task)
}
fun Environment.task(taskType: String, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
val task = taskInitialisation(taskType, description, enabled, init)
this.tasks(task)
}
fun > Environment.finalTask(constructor: () -> T, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
val finalTask = taskInitialisation(constructor, description, enabled, init)
this.finalTasks(finalTask)
}
fun Environment.finalTask(taskType: String, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
val finalTask = taskInitialisation(taskType, description, enabled, init)
this.finalTasks(finalTask)
}
fun > Environment.trigger(construct: () -> T, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
val trigger = triggerInitialisation(construct, description, enabled, init)
this.triggers(trigger)
}
fun Environment.trigger(triggerType: String, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
val trigger = triggerInitialisation(triggerType, description, enabled, init)
this.triggers(trigger)
}
fun > Environment.notification(notificationTypeConstructor: () -> T, init: SpecsDsl = {}) {
val notification = notificationInitialisation(notificationTypeConstructor, init)
this.notifications(notification)
}
fun Environment.notification(notificationTypeType: String, init: SpecsDsl = {}) {
val notification = notificationInitialisation(notificationTypeType, init)
this.notifications(notification)
}
fun > Environment.pluginConfiguration(pluginConfigurationConstructor: () -> T, init: SpecsDsl = {}) {
val pluginConfiguration = pluginConfigurationConstructor()
pluginConfiguration.init()
this.pluginConfigurations(pluginConfiguration)
}
fun Environment.pluginConfiguration(pluginConfigurationType: String, init: SpecsDsl = {}) =
pluginConfiguration({ AnyPluginConfiguration(AtlassianModule(pluginConfigurationType)) }, init)