All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.bamboo.specs.extension.bamboo-specs-extension.1.2.6.source-code.EnvironmentExtension.kt Maven / Gradle / Ivy

There is a newer version: 1.3.18
Show newest version
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)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy