Zuehlke / cookbook-windev

One cookbook with resources for setting up a Windows development environment
MIT License
7 stars 1 forks source link

Create version tags #3

Closed tknerr closed 8 years ago

tknerr commented 9 years ago

Maybe it's just a matter of git push --tags, but the metadata says we are on 0.2.0 but I don't see either the 0.1.0 or 0.2.0 tags in here.

tknerr commented 9 years ago

And how do we deal with "dev" versions anyway?

Chef (and berkshelf and other cookbook dependency solvers) does not support semver pre-release identifiers yet, i.e we can only have "0.2.0" but not "0.2.0.dev".

So in order to indicate "dev" versions we should use a "dev-odd" versioning scheme, i.e. odd versions are dev versions (e.g. "0.2.1"), and even versions are tagged and released ones (e.g. "0.2.2").

Afaik that's how its handled in the chef community, too.

damphyr commented 9 years ago

We should hash this out. I haven't ever really used tags, it never had a practical application. Is there something I am missing here, are tags used by Berkshelf or any other tool?

damphyr commented 9 years ago

And yes it is simply a matter of pushing the tags :)

tknerr commented 9 years ago

@damphyr yes tags are used by berkshelf, e.g. in your Berksfile:

source "https://supermarket.chef.io"

metadata

cookbook "windev", git: "git://github.com/Zuehlke/cookbook-windev.git", ref: "v0.1.0" 

This would pull v0.1.0 from github.

Of course you could use any commit sha ref as well...

cookbook "windev", git: "git://github.com/Zuehlke/cookbook-windev.git", ref: "442d2a2bd3dc100271667d4abef9bd7574a0f20f"

...but tags are obviously better for pointing at tagged versions ;-)

Specifiying the Git location as above (in either sha / tag / branch refs) is especially necessary for private cookbooks which are not published to the supermarket.

But even if they are published to supermarket (and windev would be a good candidate imho once we make this repo public), it is good style to push the release tags too. How else would someone be able to find the according source code to what was released as 0.1.0 on supermarket?

tknerr commented 9 years ago

Btw: stove would probably be the tool of choice for releasing (= tagging, then pushing to git + supermarket) cookbooks.

A rakeified example here (not sure if that still works, haven't used it for a while now): https://github.com/tknerr/sample-toplevel-cookbook/blob/master/Rakefile#L27-35

damphyr commented 8 years ago

Been using stove to manage this together with the supermarket package. Not perfect but it does the job.

tknerr commented 8 years ago

:+1: tags are there, looks live stove creates them automagically

tknerr commented 8 years ago

@damphyr mind adding the stove call to the Rakefile? I always forget which args to pass...

damphyr commented 8 years ago

There are no arguments (--username and --key for the credentials to Chef supermarket, but we're not checking them in :wink:). It reads everything off the metadata and the git remote.

stove is a bit of a PITA because it sets the tag, then tries to login to GitHub and it never actually cleans up after itself so if something goes wrong you need to delete the tag locally and then possible remove the tag from GitHub etc. etc.

Not something I would put in the Rakefile like that.