Skip to content

Commit

Permalink
fix: task registering fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed May 2, 2022
1 parent baddaa5 commit e893565
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ class TasksConfigurator {
this.project = project
Provider<ComposeExecutor> composeExecutor = ComposeExecutor.getInstance(project, composeSettings)
Provider<ServiceInfoCache> serviceInfoCache = ServiceInfoCache.getInstance(project, composeSettings.nestedName)
this.downTask = project.tasks.register(name ? "${name}ComposeDown".toString() : 'composeDown', ComposeDown) {task ->
configureDownForcedTask(task, composeExecutor, serviceInfoCache)
task.stopContainers.set(composeSettings.stopContainers)
}
this.downForcedTask = project.tasks.register(name ? "${name}ComposeDownForced".toString() : 'composeDownForced', ComposeDownForced) {task ->
configureDownForcedTask(task, composeExecutor, serviceInfoCache)
}
def downForcedOnFailureTask = project.tasks.register(name ? "${name}ComposeDownForcedOnFailure".toString() : 'composeDownForcedOnFailure', ComposeDownForced) {task ->
configureDownForcedTask(task, composeExecutor, serviceInfoCache)
task.onlyIf { task.serviceInfoCache.get().startupFailed }
}
this.downForcedOnFailureTask = downForcedOnFailureTask
this.upTask = project.tasks.register(name ? "${name}ComposeUp".toString() : 'composeUp', ComposeUp) {task ->
task.stopContainers.set(composeSettings.stopContainers)
task.forceRecreate.set(composeSettings.forceRecreate)
Expand Down Expand Up @@ -70,17 +82,6 @@ class TasksConfigurator {
buildBeforePull ? [buildTask] : []
})
}
this.downTask = project.tasks.register(name ? "${name}ComposeDown".toString() : 'composeDown', ComposeDown) {task ->
configureDownForcedTask(task, composeExecutor, serviceInfoCache)
task.stopContainers.set(composeSettings.stopContainers)
}
this.downForcedTask = project.tasks.register(name ? "${name}ComposeDownForced".toString() : 'composeDownForced', ComposeDownForced) {task ->
configureDownForcedTask(task, composeExecutor, serviceInfoCache)
}
this.downForcedOnFailureTask = project.tasks.register(name ? "${name}ComposeDownForcedOnFailure".toString() : 'composeDownForcedOnFailure', ComposeDownForced) {task ->
configureDownForcedTask(task, composeExecutor, serviceInfoCache)
task.onlyIf { task.serviceInfoCache.get().startupFailed }
}
this.logsTask = project.tasks.register(name ? "${name}ComposeLogs".toString() : 'composeLogs', ComposeLogs) {task ->
task.containerLogToDir.set(composeSettings.containerLogToDir)
task.composeExecutor.set(composeExecutor)
Expand Down

0 comments on commit e893565

Please sign in to comment.