Skip to content

Commit

Permalink
Fixes jibExportDockerContext Input vs. OutputDirectory and changes CL…
Browse files Browse the repository at this point in the history
…I option to --targetDir. (#499)
  • Loading branch information
coollog authored Jul 3, 2018
1 parent 855d7ad commit 6db0a01
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions jib-gradle-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.

### Fixed

- Set `jibExportDockerContext` output directory with command line option `--targetDir` ([#499](https://github.com/GoogleContainerTools/jib/pull/499))

## 0.9.1

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,22 @@ public FileCollection getInputFiles() {
}

/**
* @return the output directory for the Docker context is by default {@code build/jib-docker-
* context}.
* The output directory to check for task up-to-date.
*
* @return the output directory
*/
@Input
@OutputDirectory
public String getOutputDirectory() {
return getTargetDir();
}

/**
* Returns the output directory for the Docker context. By default, it is {@code
* build/jib-docker-context}.
*
* @return the output directory
*/
@Input
public String getTargetDir() {
if (targetDir == null) {
return getProject().getBuildDir().toPath().resolve("jib-docker-context").toString();
Expand All @@ -85,11 +96,11 @@ public String getTargetDir() {
}

/**
* The output directory can be overriden with the {@code --jib.dockerDir} command line option.
* The output directory can be overriden with the {@code --targetDir} command line option.
*
* @param targetDir the output directory.
*/
@Option(option = "jib.dockerDir", description = "Directory to output the Docker context to")
@Option(option = "targetDir", description = "Directory to output the Docker context to")
public void setTargetDir(String targetDir) {
this.targetDir = targetDir;
}
Expand Down

0 comments on commit 6db0a01

Please sign in to comment.