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

New doc explaining vcs_version. #16092

Merged
merged 2 commits into from
Jul 8, 2022
Merged

Conversation

benjyw
Copy link
Contributor

@benjyw benjyw commented Jul 7, 2022

[ci skip-rust]

[ci skip-build-wheels]

@benjyw
Copy link
Contributor Author

benjyw commented Jul 7, 2022

It'll be an adventure to see if we can sync a new doc up to readme.com this way. From my perusal of the rdme docs it should work, but we'll see.

@benjyw benjyw requested review from chrisjrn, stuhood and kaos July 7, 2022 23:46
@benjyw
Copy link
Contributor Author

benjyw commented Jul 7, 2022

@kaos Can you think of a way to use this to generate docker image tags? I couldn't find a way to tag an image based on a string in a file, but you'll know better than I.

Copy link
Member

@kaos kaos left a comment

Choose a reason for hiding this comment

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

I think we would want a generic way to load target field values from files on disk in a generic way, akin to the http_source object.

target(
  tags=file_source("path/to/my-tags.yaml"),
  description=file_source("path/to/description.txt"),
)

@kaos
Copy link
Member

kaos commented Jul 8, 2022

Can you think of a way to use this to generate docker image tags? I couldn't find a way to tag an image based on a string in a file, but you'll know better than I.

No, I think the better way would be the file_source suggestion mentioned above, otherwise it would be leveraging the #16077 feature but that would still require a custom plugin if we don't add something to it for this particular case (which I think would be inferior to the file_source alternative).

Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks!

[ci skip-rust]

[ci skip-build-wheels]
@benjyw
Copy link
Contributor Author

benjyw commented Jul 8, 2022

I think we would want a generic way to load target field values from files on disk in a generic way, akin to the http_source object.

Trouble is, these aren't "files on disk" - these get generated long after BUILD files have been parsed. So it might not be that simple.

[ci skip-rust]

[ci skip-build-wheels]
@benjyw benjyw force-pushed the vcs_version_docs branch from dac3b6f to 78af355 Compare July 8, 2022 16:18
@benjyw benjyw merged commit 6c16484 into pantsbuild:main Jul 8, 2022
@benjyw benjyw deleted the vcs_version_docs branch July 8, 2022 18:23
benjyw added a commit to benjyw/pants that referenced this pull request Jul 8, 2022
[ci skip-rust]

[ci skip-build-wheels]
benjyw added a commit that referenced this pull request Jul 8, 2022
@da-tubi
Copy link

da-tubi commented Aug 1, 2022

How can I use the version produced by vcs_version for packaging and publishing purpose?

@benjyw
Copy link
Contributor Author

benjyw commented Aug 1, 2022

@da-tubi what is your current packaging/publishing process? Which language are we talking about?

Currently this generates a file that other Pants rules can read and act on, but it really depends on the details.

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.

4 participants