Skip to content

Commit

Permalink
Use project version as default tag (#513)
Browse files Browse the repository at this point in the history
Use project version as default tag
  • Loading branch information
fawind authored Jan 4, 2022
1 parent ec43241 commit 3ce2d29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-513.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Use project version as default tag
links:
- https://github.com/palantir/gradle-docker/pull/513
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.google.common.base.Preconditions
import com.google.common.base.Strings
import com.google.common.collect.ImmutableMap
import com.google.common.collect.ImmutableSet
import com.google.common.collect.Sets
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.CopySpec
Expand Down Expand Up @@ -70,7 +71,7 @@ class DockerExtension {
public void setDockerComposeTemplate(String dockerComposeTemplate) {
this.dockerComposeTemplate = dockerComposeTemplate
Preconditions.checkArgument(project.file(dockerComposeTemplate).exists(),
"Could not find specified template file: %s", project.file(dockerComposeTemplate))
"Could not find specified template file: %s", project.file(dockerComposeTemplate))
}

public void setDockerComposeFile(String dockerComposeFile) {
Expand All @@ -90,7 +91,7 @@ class DockerExtension {
}

public Set<String> getTags() {
return tags
return Sets.union(this.tags, ImmutableSet.of(project.getVersion().toString()))
}

@Deprecated
Expand Down

0 comments on commit 3ce2d29

Please sign in to comment.