Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DockerAlias should use dockerRepository and dockerUsername from Docker scope #1092

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

jjst
Copy link
Contributor

@jjst jjst commented Jan 18, 2018

When originally introduced in 885541e dockerTarget used dockerRepository and dockerUsername defined in the Docker scope.

Sometime in the process of dockerTarget being refactored and renamed to dockerTag and then dockerAlias, it was made to use the value from dockerRepository from the global scope instead of the docker scope. ie, defining

dockerRepository in Docker := "my-custom-repository"
dockerUsername in Docker := "john"

used to work, but now has no effect, as shown by looking up the value of dockerAlias:

sbt:test-docker> docker:dockerAlias
[info] DockerAlias(None,None,test-docker,Some(0.0.0-SNAPSHOT))

Instead one must define them globally

dockerRepository := "my-custom-repository"
dockerUsername := "john"
sbt:test-docker> docker:dockerAlias
[info] DockerAlias(Some(my-custom-repository/john,None,test-docker,Some(0.0.0-SNAPSHOT))

I believe this was unintentional, and there's a fair amount of code out there still using the Docker scope for dockerRepository. This change reverts back to using the Docker scope for dockerRepository and dockerUsername when determining the docker alias. This change should be backwards-compatible as defining dockerRepository or dockerUsername on the Global scope means it's also inherited by the Docker scope.

Tested locally by defining dockerRepository both with no scope and with the Docker scope in a build file and examining the value of docker:dockerAlias. Happy to add a scripted test if required.

Copy link
Contributor

@muuki88 muuki88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for taking care of this 😍

Actually I'm not quite sure if this was unintentional or not. Usually we don't scope the settings/tasks that are already prefixed with the format name (e.g. dockerRepository).

Still this change doesn't render dockerRepository := Some("...") code invalid, so keeping old code in other repos running is a good thing to do.

@muuki88 muuki88 merged commit adc3594 into sbt:master Jan 19, 2018
@muuki88 muuki88 added the docker label Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants