This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Defined task outputs for compose tasks
- Loading branch information
Showing
6 changed files
with
43 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ dependencies { | |
} | ||
|
||
group = 'org.rewedigital' | ||
version = '0.2' | ||
version = '0.3' | ||
|
||
gradlePlugin { | ||
plugins { | ||
|
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
9 changes: 7 additions & 2 deletions
9
src/main/groovy/org/rewedigital/frost/tasks/FrostComposePullTask.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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
package org.rewedigital.frost.tasks | ||
|
||
|
||
import org.gradle.api.tasks.OutputDirectory | ||
import org.gradle.api.tasks.TaskAction | ||
import org.rewedigital.frost.util.Util | ||
|
||
import static org.rewedigital.frost.FrostPluginExtension.EXTENSION_NAME | ||
|
||
class FrostComposePullTask extends DockerComposeTask { | ||
|
||
@OutputDirectory | ||
def getReportDirectory() { | ||
Util.composeOutputDirectory(project) | ||
} | ||
|
||
@TaskAction | ||
@Override | ||
def action() { | ||
def cmd = ["/bin/sh"] | ||
cmd << "-c" | ||
cmd << "export TAG=${project.extensions[EXTENSION_NAME].sutTag} && ${EXECUTABLE} -f ${getComposeFile()} -f ${getComposeOverrideFile()} pull --ignore-pull-failures" | ||
|
||
Util.executeSynchronously(cmd, "docker_compose_pull") | ||
Util.executeSynchronously(cmd, "docker_compose_pull", getReportDirectory()) | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
src/main/groovy/org/rewedigital/frost/tasks/FrostComposeUpTask.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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
package org.rewedigital.frost.tasks | ||
|
||
import org.gradle.api.tasks.OutputDirectory | ||
import org.gradle.api.tasks.TaskAction | ||
import org.rewedigital.frost.util.Util | ||
|
||
import static org.rewedigital.frost.FrostPluginExtension.EXTENSION_NAME | ||
|
||
class FrostComposeUpTask extends DockerComposeTask { | ||
|
||
@OutputDirectory | ||
def getReportDirectory() { | ||
Util.composeOutputDirectory(project) | ||
} | ||
|
||
@TaskAction | ||
@Override | ||
def action() { | ||
def cmd = ["/bin/sh"] | ||
cmd << "-c" | ||
cmd << "export TAG=${project.extensions[EXTENSION_NAME].sutTag} && ${EXECUTABLE} -f ${getComposeFile()} -f ${getComposeOverrideFile()} up" | ||
|
||
Util.executeAsynchronously(cmd, "docker_compose_up") | ||
Util.executeAsynchronously(cmd, "docker_compose_up", getReportDirectory()) | ||
} | ||
} |
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