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

[improvement] docker configuration includes productDependencies #239

Merged
merged 4 commits into from Apr 10, 2019

Conversation

iamdanfox
Copy link
Contributor

@iamdanfox iamdanfox commented Apr 10, 2019

Before this PR

Internally, many repos use this plugin in conjunction with gradle-sls-packaging. When trying to create a docker-compose.yml for ETE testing, users usually want to use versions of their product dependencies.

From sls-packaging 3.7.1 onwards, there's now a convenient way of getting access to this information.

After this PR

Repos that use com.palantir.docker-compose at the root and com.palantir.sls-java-service-distribution in a subproject will now be able to magically refer to their product dependencies when templating their docker-compose.yml files:

 my-product:
    container_name: my-product.palantir.pt
    hostname: my-product
    domainname: palantir.pt
    image: 'docker-registry/foo/my-product:{{com.palantir.foo:my-product}}'
    ports:
      - "8901:8901"
      - "8902:8902"

@iamdanfox iamdanfox requested a review from a team as a code owner April 10, 2019 15:12
@dansanduleac
Copy link
Contributor

👍

// docker project(path: ':foo', configuration: 'productDependencies')
// }
project.subprojects({ Project subproject ->
subproject.getPlugins().withId("com.palantir.product-dependency-introspection", {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iamdanfox iamdanfox force-pushed the dfox/wire-up-docker-configuration branch from f067071 to d14c2d7 Compare April 10, 2019 15:29
@bulldozer-bot bulldozer-bot bot merged commit 81a99c6 into develop Apr 10, 2019
@bulldozer-bot bulldozer-bot bot deleted the dfox/wire-up-docker-configuration branch April 10, 2019 15:37
@qinfchen
Copy link
Contributor

Does this mean product dependencies must be specified now?

* What went wrong:
Execution failed for task ':generateDockerCompose'.
> Could not resolve all dependencies for configuration ':docker'.
   > Could not resolve project :dummy-server.
     Required by:
         project :
      > Project : declares a dependency from configuration 'docker' to configuration 'productDependencies' which is not declared in the descriptor for project :.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

@iamdanfox
Copy link
Contributor Author

No, that looks like a bug. Can you link the actual repro to the internal slack channel so we can poke around?

@dansanduleac
Copy link
Contributor

dansanduleac commented Jul 1, 2019

For future reference, this was due to the root project (where we defined the docker configuration being resolved) having the same group:name as a subproject. This is an artifact of how gradle dependency resolution works.
The dependency project : conf 'docker' -> project :subproject conf productDependencies got resolved by gradle to project : conf productDependencies because : and :subproject had the same group and name, and because it had already seen and cached the group:name of : (the root project) since resolution started from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants