-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from double16/composepull
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/groovy/com/avast/gradle/dockercompose/tasks/ComposePull.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.avast.gradle.dockercompose.tasks | ||
|
||
import com.avast.gradle.dockercompose.ComposeExtension | ||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.tasks.TaskAction | ||
import org.gradle.process.ExecSpec | ||
|
||
class ComposePull extends DefaultTask { | ||
|
||
ComposeExtension extension | ||
|
||
ComposePull() { | ||
group = 'docker' | ||
description = 'Pulls and builds all images of docker-compose project' | ||
} | ||
|
||
@TaskAction | ||
void pull() { | ||
if (extension.buildBeforeUp) { | ||
project.exec { ExecSpec e -> | ||
e.environment = extension.environment | ||
e.commandLine extension.composeCommand('build') | ||
} | ||
} | ||
project.exec { ExecSpec e -> | ||
e.environment = extension.environment | ||
e.commandLine extension.composeCommand('pull') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters