https://pantsbuild.org/ logo
#general
Title
# general
d

damp-mouse-24788

01/14/2019, 9:11 PM
Some context: All of our code base is not in the monorepo. One of the utility in the monorepo needs to be published to artifactory. I would like to suffix commit_hash and build number to the artifact name. Couldn’t figure out how to do it. Thanks!
w

witty-crayon-22786

01/14/2019, 10:28 PM
the artifact name comes from the
provides
clause in your BUILD file
you could suffix onto the artifact name with a pants plugin/macro that you'd reference from your BUILD file, but suffixing onto the version is possible with
publish.jar
options
...oh, hm. I guess it's the other way around. it's hard to publish with a suffix on the version. it's easy to publish a completely custom version with
--publish-jar-named-snapshot
though:
Copy code
--publish-jar-named-snapshot=<str> (default: None)
    Publish all artifacts with the given snapshot name, replacing their version.
    This is not Semantic Versioning compatible, but is easier to consume in
    cases where many artifacts must align.
so we do nightly "named snapshot" publishes of everything relevant in our monorepo with a version like:
Copy code
--named-snapshot=`date +"%Y%m%d%H%M%S"`"$SLUG"-`git rev-parse --verify --short HEAD`
d

damp-mouse-24788

01/14/2019, 10:44 PM
thank you. that was quick.Will try these and update.
3 Views