com.avast.gradle.dockercompose.tasks.ComposeBuild.groovy Maven / Gradle / Ivy
package com.avast.gradle.dockercompose.tasks
import com.avast.gradle.dockercompose.ComposeExecutor
import groovy.transform.CompileStatic
import org.gradle.api.DefaultTask
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction
@CompileStatic
abstract class ComposeBuild extends DefaultTask {
@Internal
abstract ListProperty getBuildAdditionalArgs()
@Internal
abstract ListProperty getStartedServices()
@Internal
abstract Property getComposeExecutor()
ComposeBuild() {
group = 'docker'
description = 'Builds images for services of docker-compose project'
}
@TaskAction
void build() {
String[] args = ['build']
args += (List) buildAdditionalArgs.get()
args += (List) startedServices.get()
composeExecutor.get().execute(args)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy