-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register push tasks for every image definition
These push tasks allow to specify --name and --tag options
- Loading branch information
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/kotlin/io/github/sgtsilvio/gradle/oci/OciPushSingleTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.github.sgtsilvio.gradle.oci | ||
|
||
import org.gradle.api.tasks.Internal | ||
import org.gradle.api.tasks.options.Option | ||
import org.gradle.kotlin.dsl.property | ||
import org.gradle.kotlin.dsl.setProperty | ||
import org.gradle.work.DisableCachingByDefault | ||
import org.gradle.workers.WorkerExecutor | ||
import javax.inject.Inject | ||
|
||
/** | ||
* @author Silvio Giebl | ||
*/ | ||
@DisableCachingByDefault(because = "Pushing to an external registry") | ||
abstract class OciPushSingleTask @Inject constructor(workerExecutor: WorkerExecutor) : OciPushTask(workerExecutor) { | ||
|
||
@get:Internal | ||
@get:Option( | ||
option = "name", | ||
description = "Names the image. If not specified the imageName defined in the image definition is used.", | ||
) | ||
val imageName = project.objects.property<String>() | ||
|
||
@get:Internal | ||
@get:Option( | ||
option = "tag", | ||
description = "Tags the image. Option can be specified multiple times. The value '.' translates to the imageTag defined in the image definition. If not specified the imageTag defined in the image definition is used.", | ||
) | ||
val imageTags = project.objects.setProperty<String>() | ||
} |