com.avast.gradle.dockercompose.tasks.ComposePush.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.
The newest version!
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 ComposePush extends DefaultTask {
@Internal
abstract Property getIgnorePushFailure()
@Internal
abstract ListProperty getPushServices()
@Internal
abstract Property getComposeExecutor()
ComposePush() {
group = 'docker'
description = 'Pushes images for services of docker-compose project'
}
@TaskAction
void push() {
String[] args = ['push']
if (ignorePushFailure.get()) {
args += '--ignore-push-failures'
}
args += (List) pushServices.get()
composeExecutor.get().execute(args)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy