Skip to content

Commit

Permalink
Support allow empty archive (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
c42-arthur authored Aug 10, 2023
1 parent 0b4468d commit 0bed78e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import com.code42.jenkins.pipelinekt.dsl.DslContext
import com.code42.jenkins.pipelinekt.internal.step.declarative.ArchiveArtifacts

fun DslContext<Step>.archiveArtifacts(artifacts: String, fingerprint: Boolean) =
archiveArtifacts(artifacts.strDouble(), fingerprint)
archiveArtifacts(artifacts.strDouble(), fingerprint, false)

fun DslContext<Step>.archiveArtifacts(artifacts: Var.Literal.Str, fingerprint: Boolean) {
add(ArchiveArtifacts(artifacts, fingerprint))
fun DslContext<Step>.archiveArtifacts(artifacts: String, fingerprint: Boolean, allowEmptyArchive: Boolean) =
archiveArtifacts(artifacts.strDouble(), fingerprint, allowEmptyArchive)

fun DslContext<Step>.archiveArtifacts(artifacts: Var.Literal.Str, fingerprint: Boolean, allowEmptyArchive: Boolean) {
add(ArchiveArtifacts(artifacts, fingerprint, allowEmptyArchive))
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import com.code42.jenkins.pipelinekt.core.writer.GroovyWriter
* @param artifacts the artifacts to archive, blob pattern
* @param fingerprint whether the artifact is part of the archives fingerprints
*/
data class ArchiveArtifacts(val artifacts: Var.Literal.Str, val fingerprint: Boolean = false) : DeclarativeStep, SingletonStep {
data class ArchiveArtifacts(val artifacts: Var.Literal.Str, val fingerprint: Boolean = false, val allowEmptyArchive: Boolean = false) : DeclarativeStep, SingletonStep {
override fun toGroovy(writer: GroovyWriter) {
writer.writeln("archiveArtifacts artifacts: ${artifacts.toGroovy()}, fingerprint: $fingerprint")
writer.writeln("archiveArtifacts artifacts: ${artifacts.toGroovy()}, fingerprint: $fingerprint, allowEmptyArchive: $allowEmptyArchive")
}
}
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.21
0.19.0

0 comments on commit 0bed78e

Please sign in to comment.