-
Notifications
You must be signed in to change notification settings - Fork 75
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
Populate the 'version' file as part of 'charmcraft build' #37
Comments
What we'll put in the 'automatic version file'? We only have the git hash, users will want the version to be 1.0, 1.1. I'm +1 for build to produce something if not there, but a good formed project probably should provide its own information there. Versioning is important :) |
Is this issue is about allowing charm consumers to verify which revision of a charm's source code it was generated from (which I think it is based on the original comment)? If so I don't think we're talking about a version of "1.0" or "1.1". If not I'd like to file a separate issue for that, as it's needed as part of canonical/charmhub.io#727. |
Conclusion of what we'll do is:
In the future we may add a keyword in |
We dropped the idea of automatically saving a |
@facundobatista can Charmcraft as a tool detect the presence of the Reason for this is that we've written a few charms now that rely on the If Charmhub were to manage something, perhaps it would use it's own ".charmhub_version" or just not update what's in the charm itself but retrieve from it's own DB. |
We decided to not create a version file if it does not exist. As commented above, there are some fundamental changes on how Charmhub/Juju will handle the concept of version and how/where it will be expressed. We need to wait for that to be designed before we understand what (if something) we need to do in Charmcraft. |
charmcraft team, hi This continues to be an issue for air gapped deployments and support later on. We really need a solution here, as Juju does support manually setting revision numbers with "revision" file, but charmcraft ignores it when it generates the .charm file. I have filed a similar bug requesting juju to have an option to set channel information for local charms in LP#2039544. |
Adding the following:
Allow to push the revision file with the charm. Is there an env variable to define |
Note that you can create a 'version' file with whatever you would like, and
charmcraft will preserve it in the .charm file.
'revision' is dangerous for other reasons, but as long as your build
pipeline creates a 'version' file, charmcraft will preserve it. (`git
describe --tags --dirty > version` is generally a reasonable build stage)
…On Tue, Oct 17, 2023 at 6:38 AM phvalguima ***@***.***> wrote:
Adding the following:
parts:
charm:
...
override-stage: |
craftctl default
cp /root/parts/charm/build/revision /root/stage/revision
prime:
- revision
Allow to push the revision file with the charm. Is there an env variable
to define /root/stage and /root/parts/charm/build?
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABRQ7KLRXU2Z5U7SCWXWITX7ZN3JAVCNFSM4N7TZ3LKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZWGYYTINRQG44A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
When Juju creates a charm .zip file from a directory, one of the steps is to populate the version file:
https://github.com/juju/charm/blob/master/charmdir.go#L268
https://github.com/juju/charm/blob/5fe646695e8585e7a6b9fedb0d10cc7fbc598e48/charmdir.go#L521
That allows for a nice way to track back what content is running on a given server, tied back into the source tree that it was generated from.
The text was updated successfully, but these errors were encountered: