Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #67 Any type of project can now use a Dockerfile.template
- Loading branch information
Showing
4 changed files
with
45 additions
and
5 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
2 changes: 2 additions & 0 deletions
2
src/test/gradle-projects/build-templated-dockerfile/Dockerfile.template
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,2 @@ | ||
FROM scratch | ||
LABEL image.version="${project.version}" |
30 changes: 30 additions & 0 deletions
30
src/test/gradle-projects/build-templated-dockerfile/build.gradle
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 @@ | ||
import static org.stackwork.gradle.docker.ModuleType.* | ||
|
||
buildscript { | ||
repositories { | ||
maven { url = "file://${project.projectDir}/../../../../build/repoForTests" } | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath group: 'org.stackwork.gradle', name: 'stackwork', version: '0.1-TEST' | ||
} | ||
} | ||
apply from: '../../gradle-plugins/stackwork-extended-for-tests.gradle' | ||
|
||
version='1' | ||
|
||
stackwork { | ||
moduleType = IMAGE | ||
} | ||
|
||
task('inspectImage', | ||
description: 'Inspect the image. If this works, we know it has been built.', | ||
group: 'Stackwork', | ||
type: Exec) { | ||
commandLine 'docker', 'inspect', '--format=\'{{.Id}}\'', "${-> project.stackwork.imageId}" | ||
} | ||
|
||
tasks.inspectImage.dependsOn tasks.buildImage | ||
afterEvaluate { | ||
tasks.stackworkCheck.dependsOn tasks.inspectImage | ||
} |
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