Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Misc bugfixes for the docker plugin #270

Merged
merged 4 commits into from
Dec 13, 2016
Merged

Conversation

jkinkead
Copy link
Contributor

This fixes #266, #268, and a few cache key bugs.

Jesse Kinkead added 3 commits December 12, 2016 15:23
This has several fixes / changes:
- changes to remote dependencies will be detected
- cache keys will remain stable accross rebuilds
- cache keys will not be generated on dirty repos (same behavior as old
  deploy plugin)
Copy link
Contributor

@ckarenz ckarenz left a comment

Choose a reason for hiding this comment

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

One minor comment about executable flags. This change fixes a bunch of stuff. Thanks!

case (source, destination) =>
if (source.canExecute) {
destination.setExecutable(true)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd replace this if block with destination.setExecutable(source.canExecute). That way if we'll sync up the flag if the destination was marked executable, but the source's flag has changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the copy line beforehand will replace the target, so this might work regardless - but this is cleaner. Updated!

// Find the git commits for the current project and local dependencies, since this is more
// stable than a hash of the contents.
val unstableContentsCommits: Seq[Option[String]] = {
(Def.taskDyn(gitCommitIfClean.all(HelperDefs.dependencyFilter.value)).value :+
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like that you're doing this by project, so an unrelated change won't dirty it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are some edge-cases where this breaks, unfortunately. Notably, this doesn't take into account changes in root sbt settings (settings in the root build.sbt or root project/*). However, these would have to be changes which affected the compiled code but not either dependencies or the Dockerfile - so, things like updates to the docker plugin...

:P

@jkinkead jkinkead merged commit 1964dfa into allenai:master Dec 13, 2016
@jkinkead jkinkead deleted the bugfixes branch December 13, 2016 04:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

During dockerBuild, dockerCopyMappings doesn't retain file flags
2 participants