-
Notifications
You must be signed in to change notification settings - Fork 905
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
Check for package version on choco push
#494
Comments
So what I think this would be is more of a warning. You push it and it will warn you but push anyways. Many folks use automation to push newer versions. If it stops pushing, that would be a breaking change. |
Can we go for something where the default action is the warning message and push the package but if the I'm kind of pushing it to a solution for my current issue which I understand is not the way to go. What I actually would like to have is a mechanism that when executing Just to give a little bit of context follow my scenario: Do you think it would be useful to other people as well? Am I overcomplicating it? Does it even make sense what I'm doing? 😝 |
It might (the |
@tirolo where are you pushing these packges to? i.e. what are you using to host them? As an interim measure, you could do an md5 hash on the files that are generated by the choco pack, and only push the ones that have changed? |
It's a shared folder in the network then I use the UNC path as the
|
@tirolo If you were using something like Artifactory as your NuGet server it has this intelligence on its side that only stores a single copy of a package with a given hash, and uploading the same hash with a new version just adds an additional tag I think. Typically even the simple NuGet server from Chocolatey/Puppetlabs prevents you from re-pushing the same version a second time without a config change iirc. It sounds like you are rebuilding every package every time, does this result in the same checksum between runs or do you have a text/nuspec file with a version that gets embedded that would cause the checksums to be slightly different between runs? If you were using Jenkins as your build server there is actually some path monitoring built in where you could have it only build a path that had changes to the source, but it sounds like you worked it out within your VCS. |
If the source that you are pushing too is a UNC path, then checking if the package already exists should not be an issue because if choco has permission to access the UNC path to copy the package, then it should be able to read the existing packages from there without issue. However, if the source is a nuget server, then it may be more complex. For example, if the package is being pushed to a Nexus server, it is possible that choco can pushing using an apikey, but does not have permissions to check the feed for existing packages. Or if the remote source has a different url for pushing as compared to pulling (push.chocolatey.org vs community.chocolatey.org/api/v2, although that specific instance could be hardcoded). |
There has been no update to this in some time. I'm going to go ahead and close this, but we can reopen it if necessary. |
I would like to suggest that
choco push
should check the version of the package I'm trying to push against the (if available) package on the--source
and give me some options on what I want to do if the package is (for instance)older
,same
ornewer
version (from my local package perspective).So that enabling options like:
--push-only-if-newer
which would be quite handy.The text was updated successfully, but these errors were encountered: