Skip to content

Commit

Permalink
add DisableConcurrentBuildsWithAbortPrevious option (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
forest-code42 authored Feb 1, 2024
1 parent 92d209c commit 3286e84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.code42.jenkins.pipelinekt.core.vars.ext.strDouble
import com.code42.jenkins.pipelinekt.dsl.DslContext
import com.code42.jenkins.pipelinekt.internal.option.AnsiColor
import com.code42.jenkins.pipelinekt.internal.option.DisableConcurrentBuilds
import com.code42.jenkins.pipelinekt.internal.option.DisableConcurrentBuildsWithAbortPrevious
import com.code42.jenkins.pipelinekt.internal.option.LogRotator
import com.code42.jenkins.pipelinekt.internal.option.Retry
import com.code42.jenkins.pipelinekt.internal.option.SkipDefaultCheckout
Expand All @@ -27,6 +28,10 @@ fun DslContext<Option>.disableConcurrentBuilds() {
add(DisableConcurrentBuilds)
}

fun DslContext<Option>.disableConcurrentBuildsWithAbortPrevious() {
add(DisableConcurrentBuildsWithAbortPrevious)
}

fun DslContext<Option>.ansiColor(colorMapName: String) {
ansiColor(colorMapName.strDouble())
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.code42.jenkins.pipelinekt.internal.option

import com.code42.jenkins.pipelinekt.core.Option
import com.code42.jenkins.pipelinekt.core.writer.GroovyWriter

object DisableConcurrentBuildsWithAbortPrevious : Option {
override fun toGroovy(writer: GroovyWriter) {
writer.writeln("disableConcurrentBuilds(abortPrevious: true)")
}
}

0 comments on commit 3286e84

Please sign in to comment.