com.avast.gradle.dockercompose.tasks.ComposeBuild.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-docker-compose-plugin Show documentation
Show all versions of gradle-docker-compose-plugin Show documentation
Simplifies usage of Docker Compose for integration testing in Gradle environment.
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