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.PlanExtension.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.Variable
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.plan.Plan
import com.atlassian.bamboo.specs.api.builders.plan.Stage
import com.atlassian.bamboo.specs.api.builders.trigger.AnyTrigger
import com.atlassian.bamboo.specs.api.builders.trigger.Trigger


fun Plan.stage(name: String, description: String? = null, finalStage: Boolean? = null, manual: Boolean? = null, init: SpecsDsl = {}) {
    val stage = Stage(name)
    if (description != null)
        stage.description(description)
    if (finalStage != null)
        stage.finalStage(finalStage)
    if (manual != null)
        stage.manual(manual)
    stage.init()
    this.stages(stage)
}


fun > Plan.trigger(triggerConstructor: () -> T, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
    val trigger = triggerInitialisation(triggerConstructor, description, enabled, init)
    this.triggers(trigger)
}

fun Plan.trigger(triggerType: String, description: String? = null, enabled: Boolean? = null, init: SpecsDsl = {}) {
    val trigger = triggerInitialisation(triggerType, description, enabled, init)
    this.triggers(trigger)
}

fun Plan.variable(name: String, value: String, init: SpecsDsl = {}) {
    val variable = Variable(name, value)
    variable.init()
    this.variables(variable)
}

fun > Plan.notification(notificationTypeConstructor: () -> T, init: SpecsDsl = {}) {
    val notification = notificationInitialisation(notificationTypeConstructor, init)
    this.notifications(notification)
}

fun Plan.notification(notificationTypeType: String, init: SpecsDsl = {}) {
    val notification = notificationInitialisation(notificationTypeType, init)
    this.notifications(notification)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy