4

Recently I have developed cookbook and it has got version 0.1.0.

Then I have added more recipes for this cook. I want to bump version to 0.2.0.

I want to see both version when I do "knife cookbook show test".

Please help me how to do this.

Rajan Kumar
  • 718
  • 1
  • 4
  • 9

2 Answers2

3

Change the version in your metadata.rb file and then run knife cookbook upload test (or use some other cookbook upload tool if you prefer).

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • Nevertheless, I'd also like to have a way to do this programmatically. – StephenKing Mar 23 '16 at 07:22
  • Found a small snippet in [knife-flow](https://github.com/mdsol/knife-flow/blob/043c55dd32ce58a40493b9961fd3099f474b0b87/lib/chef/knife/increment.rb#L52) think I'd adapt that in a rake task. – StephenKing Mar 23 '16 at 09:29
  • 1
    @StephenKing You can have a look at [`knife-spork`](http://jonlives.github.io/knife-spork/) too – Tensibai Mar 23 '16 at 10:13
  • @Tensibai yes, I know that and it sounds appealing. I just have to get our team on track first to maybe go that one step further at a later point. – StephenKing Mar 23 '16 at 11:19
1

Found this lovely alias while searching for an easier way to do the same thing. https://github.com/jonlives/knife-spork/issues/186#issue-77717477

alias bump='knife spork bump ${PWD##*/} -o ..'

You can also do it without the ${PWD} bit, but that doesn't work if you are trying to specify major/minor/patch.

knife spork is part of the ChefDK so it should be usable on any machine where you have that installed.

dragon788
  • 3,583
  • 1
  • 40
  • 49