All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avast.gradle.dockercompose.tasks.ComposePull.groovy Maven / Gradle / Ivy

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 ComposePull extends DefaultTask {

    @Internal
    abstract Property getIgnorePullFailure()

    @Internal
    abstract ListProperty getPullAdditionalArgs()

    @Internal
    abstract ListProperty getStartedServices()

    @Internal
    abstract Property getComposeExecutor()

    ComposePull() {
        group = 'docker'
        description = 'Builds and pulls images of docker-compose project'
    }

    @TaskAction
    void pull() {
        String[] args = ['pull']
        if (ignorePullFailure.get()) {
            args += '--ignore-pull-failures'
        }
        args += (List) pullAdditionalArgs.get()
        args += (List) startedServices.get()
        composeExecutor.get().execute(args)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy