I am trying to create a platform specific package for ChefDK. When I run the command below ...
$ bundle exec omnibus build chefdk
I get this error ...
bundler: failed to load command: omnibus (/usr/local/bin/omnibus)
Gem::Exception: can't find executable omnibus for gem omnibus. omnibus is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:462:in `block in replace_bin_path'
/var/lib/gems/2.5.0/gems/bundler-1.17.3/lib/bundler/rubygems_integration.rb:482:in `block in replace_bin_path'
/usr/local/bin/omnibus:23:in `<top (required)>'
Might want to take a look at chef-workstation. It supersedes ChefDK.
Without addressing the specific issue you're hitting, the best suggestion I can give is to run the included test kitchen stuff (ie converge the centos-7 box; the kitchen.yml file is in the omnibus directory) and watch what it does.
That's not intended to be glib advice. I've spent the last few weeks trying to compile workstation and chef client. There's a bunch of [undocumented?] setup stuff done during that TK converge that I didn't know about or still haven't been able to match independently. Before realizing TK was set up to configure a VM environment, I wasted way too many hours trying to follow the limited build instructions which mostly dead-ended in tracking down ghosts and shadows - everything from make not compiling to rubyzip gem is not installed
omnibus-toolchain seems like it's a pre-req for compiling other chef stuff, but I'm still trying to figure out exactly how it fits in.
Chef's official CI/CD pipelines don't use the same techniques, they have the advantage of being able to bootstrap via Chef and cache a ton, because they can use existing supported builds. Best of luck!
Thanks,
Matt Ray
Regional Manager, Customer Architect - APJ :: Chef matt@chef.io
thanks @MattRay. That helps. Have been working on a script that looks quite similar to yours. Good to know I was heading in the general direction.
I think one thing that's confusing about omnibus-toolchain is that it builds into /opt/omnibus-toolchain, but to actually use the toolchain (ie to build chefdk/workstation), it still has to be installed via the package (rpm here, but deb is same) that was created during the build. This installs to the same location. When I ran it through TK, I saw that the converge had set up a bunch of additional symlinks in /opt/omnibus-toolchain/bin. After seeing what TK did, it seems somewhat obvious that just building the toolchain isn't enough?
It looks from your script like you run into something similar and have to clean up /opt/omnibus-toolchain before installing the package (line 46)?