Netuitive / chef-netuitive

Installs Native Netuitive Agent
MIT License
4 stars 6 forks source link

Integrate travis-ci to push to supermarket on git tag #51

Open majormoses opened 7 years ago

majormoses commented 7 years ago

Wondering if users would like us to push to the supermarket rather than just tagging it in git.

Please vote with a :+1: / :-1: accordingly, it should be pretty trivial but if the community finds little to no value then I don't want to expend the effort and introduce a new step to release process.

/cc @bspindler @TheConnMan @Createor

TheConnMan commented 7 years ago

Can you push to the supermarket during the Travis deploy step on tags only? An example of this is pushing to https://rubygems.org in the Ruby API project. That way there isn't another manual deploy step, just the normal tagging.

As far as requests for this feature I haven't heard any, @Createor would know better than anyone.

majormoses commented 7 years ago

the problem there is credentials which I suppose we could create a bot for that and store it encrypted in travis. The thing is that we will still want to manually evaluate changelog + versioning to continue to align to semver. But it could certainly be as simple as a single cli call so it is not much more effort once it is setup.

majormoses commented 7 years ago

Also we are already doing at least 2 things manually:

I suppose we might be figure out some way to have it run only on tags (I have only done that with the rubygems provider) that would be a very nice touch so its just prep work before release and then it releases everything but tbh we could just add that as a target in our Makefile as make release which would tag and push to supermarket.

Grumblesmith commented 7 years ago

I haven't seen any requests to be able to get this from supermarket. Would it being in supermarket make it easier to include in a wrapper cookbook?

majormoses commented 7 years ago

If it's not in the supermarket you must tell it where it is like this: https://github.com/CloudCruiser/ops_chef-cc_netuitive/blob/master/Berksfile#L3 as opposed to just cookbook 'netuitive'. I have honestly not really cared or messed around with the supermarket but someone required me to publish some cookbooks to the supermarket so I figured out how to do it and was curious if people were interested in doing it since it is honestly really not much more work.

Grumblesmith commented 7 years ago

If it's not much extra work (and especially if we can automate it as part of the travis build) I'd vote 👍

TheConnMan commented 7 years ago

@majormoses That Travis CI file has creds encrypted in it, take a look at https://docs.travis-ci.com/user/encryption-keys/.

I do believe that git tagging should always be a manual operation. As far as a changelog update I've been using GitHub Releases to convey changelog information instead of a history file. Either is a manual, human interpretation of changes, so I don't see too much difference between them. Both manual though.

majormoses commented 7 years ago

Ya I am familiar with using encrypted vars in for rubygems api keys what we need here would be an encrypted file like this: https://docs.travis-ci.com/user/encrypting-files/ as stove needs an actual pem file rather than it's contents.

Regarding Changelog + tag I agree it should be manual and maybe in that case we just add it to the Makefile so that when we tag stove can just publish to supermarket in one fell swoop. I would imagine it look something like this:

release: gittag ## tag and push cookbook to supermarket
    bundle exec stove stove --no-git

If you are wondering why we are not just using the git module built into stove I personally find the extra "v" in front of the version useless and make gittag allows you to re-tag (stove does not) which I discovered after dealing with an auth issue caused by: https://github.com/sethvargo/stove/issues/120 for a different project.

TheConnMan commented 7 years ago

Whether you tag and publish locally with one command or publish based on a tag push you still get both done with one manual step. I personally prefer publishing in the Travis build because git tagging doesn't require a working Ruby environment (which I rarely have) whereas bundle does. Also using the Travis file allows any maintainer to publish because the creds are embedded in the project. Otherwise we'd need a way to share credentials.

majormoses commented 7 years ago

I looked into it and there is a chef supermarket travis deploy provider so we should just run that on tags and then the manual steps are just update changelog, commit, push, and tag

majormoses commented 7 years ago

I pushed an initial version to the supermarket, can you guys setup the bot and travis that way Netuitive owns it going forward (in case I ever want to no longer maintain this cookbook at some point in the future).

TheConnMan commented 7 years ago

Yes, I'll take care of it and I'll email you the service account when I make it so you can add it as a collaborator.

majormoses commented 7 years ago

@TheConnMan pinging to see where you are at

TheConnMan commented 7 years ago

Still on my todo list, I've been punting it week to week. I should be coming out of the woods in the next week to tackle it.

TheConnMan commented 7 years ago

@majormoses Our service account username is metricly

majormoses commented 7 years ago

@TheConnMan I am not finding this metricly user: image

majormoses commented 7 years ago

image

majormoses commented 6 years ago

@TheConnMan ping still need the username in order to add it as a collaborator and make this all more automatic. In the mean time I can keep pushing to the supermarket manually.