Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Add brew-boxen-cask-install #57

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Add brew-boxen-cask-install #57

wants to merge 14 commits into from

Conversation

n0ts
Copy link
Contributor

@n0ts n0ts commented Nov 27, 2017

Hello, brew install Caskroom/versions/google-chrome-canary is not working.
And my custom cask is not installing via puppet-brewcask module.
So I add brew custom install command brew boxen-cask-install <cask>.

Thanks,

if install_options.any?
execute ["brew", "install", "Caskroom/cask/#{resource[:name]}", *install_options].flatten, command_opts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only looking at why Canary wasn't installing for me last week and completely overlooked this.

@@ -27,7 +27,7 @@ def self.caskroom
end

def self.current(name)
caskdir = Pathname.new "#{caskroom}/#{name}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to stay as double quotes otherwise it won't be evaluated and interpolated correctly.

@@ -36,7 +36,7 @@ def self.legacy_caskroom
end

def self.new_caskroom
@new_caskroom ||= Pathname.new("#{home}/Caskroom")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to stay as double quotes otherwise it won't be evaluated and interpolated correctly.

end
install_cmd << install_options if install_options.any?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be able to go under the existing if install_options.any? a couple of lines up. Should become something like this and save the extra inline expression:

def install
  install_cmd = ['brew']

  if install_options.any?
    install_cmd << 'cask install'
    install_cmd << install_options
  else
    install_cmd << 'boxen-cask-install'
  end
  
  install_cmd << resource[:name]

  execute install_cmd.flatten, command_opts
end

README.md Outdated
@@ -15,7 +15,7 @@ package { 'firefox': provider => 'brewcask' }

## Required Puppet Modules

- `homebrew`, >= 1.10.0
- `homebrew` >= 1.10.0

## Work in progress
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this wasn't you but can you delete this section? I don't think it really adds any value or information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I same as puppuet-homebrew/README

@jacobbednarz
Copy link
Member

Running this patch locally now to see how we go!

@jacobbednarz
Copy link
Member

Getting some better (actually installing!) but not great behaviour. It looks like once it's installed a package, the next run fails with this message.

Error: Execution of 'brew boxen-cask-install sysdig-inspect' returned 1: ==> Satisfying dependencies
==> Downloading https://download.sysdig.com/stable/sysdig-inspect/sysdig-inspect-0.2.0-mac.dmg
Already downloaded: /Users/jacob/Library/Caches/Homebrew/Cask/sysdig-inspect--0.2.0.dmg
==> Verifying checksum for Cask sysdig-inspect
==> Installing Cask sysdig-inspect
Error: It seems there is already an App at '/Applications/Sysdig Inspect.app'.
Error: /Stage[main]/Boxen::Personal/Package[sysdig-inspect]/ensure: change from absent to present failed: Execution of 'brew boxen-cask-install sysdig-inspect' returned 1: ==> Satisfying dependencies
==> Downloading https://download.sysdig.com/stable/sysdig-inspect/sysdig-inspect-0.2.0-mac.dmg
Already downloaded: /Users/jacob/Library/Caches/Homebrew/Cask/sysdig-inspect--0.2.0.dmg
==> Verifying checksum for Cask sysdig-inspect
==> Installing Cask sysdig-inspect
Error: It seems there is already an App at '/Applications/Sysdig Inspect.app'.

I think this might be Homebrew though...

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

@jacobbednarz Thanks for local test!

My local environment manifest is bellow, It's working.

# My manifest
  package { 'sysdig-inspect':
      provider => 'brewcask',
  }

$ boxen --no-pull
...

$ brew cask info sysdig-inspect
sysdig-inspect: 0.2.0
https://github.com/draios/sysdig-inspect
/opt/boxen/homebrew/Caskroom/sysdig-inspect/0.2.0 (68B)
From: https://github.com/caskroom/homebrew-cask/blob/master/Casks/sysdig-inspect.rb
==> Name
Sysdig Inspect
==> Artifacts
Sysdig Inspect.app (App)

Are you manually installing sysdig-inspect application?


it 'should return install command' do
expect{ @provider.install }.to raise_error(Puppet::ExecutionFailure,
/brew boxen-cask-install cask/)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brew command is failed, so I check exception message command name.

@jacobbednarz
Copy link
Member

Nope, I'm all Boxen hiera configuration. I do occasionally get the following error which might be something underlying in Homebrew that isn't quite working as expected.

Error: /usr/local/Homebrew already exists.
Please remove it manually or uninstall and reinstall Homebrew into a new
location as the migration cannot be done automatically.
==> Migrating HOMEBREW_REPOSITORY (please wait)...
Wrapped exception:
Execution of 'brew update' returned 1: Updated 3 taps (caskroom/cask, caskroom/versions, homebrew/core).

Which is very annoying considering this is a freshly out of the box machine 😞

@jacobbednarz
Copy link
Member

I've done a bit of wiping/re-Homebrewing here and this all looks good now. Once the specs are 💚 I'm happy to merge.

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

@jacobbednarz CI is now passed. (I add my GITHUB_API_TOKEN environment) I changed travis os is osx, But osx is too slow CI. I'll fix boxen gem, And travis os revert to linux, Thanks.
https://travis-ci.org/n0ts/puppet-brewcask

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

@jacobbednarz Could you add GITHUB_API_TOKEN? Master CI is failed..

@jacobbednarz
Copy link
Member

I don't think we need to change the OS this runs on since the specs aren't doing anything OSX specific - it's just rspec for the puppet classes. I think we hit the rate limiting issue since we were running so many builds yesterday and before I look at adding a GitHub token, I'd like to see how often it comes up because this repository is pretty slow moving.

We aren't running anything OSX specific so let's use the generic Linux agents
@jacobbednarz
Copy link
Member

I've updated the CI OS options via 3ab67cd so now we've just gotta look at https://travis-ci.org/boxen/puppet-brewcask/builds/308649030#L595

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

I'll find out brewcask defined type self.home

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

Facter.value(:homebrew_root) => boxen gem facter facter/boxen.rb => boxen gem Boxen::Config.load => Boxen::Keychain.new config.user => Boxen::Keychain::get => keychain is runnig only macos...

Do use calling facter on CI? 🤔

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

Could you waiting for merge PR?
I'll fix boxen gem quickly, Thanks.

@n0ts
Copy link
Contributor Author

n0ts commented Nov 28, 2017

(ref) boxen/boxen#219

@n0ts
Copy link
Contributor Author

n0ts commented Dec 18, 2017

boxen 3.1.1 has been released.
puppet-brewcask use cardboard ref: boxen/cardboard#18

@jacobbednarz
Copy link
Member

@n0ts are you interested in finishing this one up?

@n0ts
Copy link
Contributor Author

n0ts commented Feb 8, 2018

@jacobbednarz Thanks for ping. Could you new release cardboard (inside boxen gem version 3.1.1)?

@jacobbednarz
Copy link
Member

@n0ts do you mean like boxen/cardboard#19? If that's correct I'll release that.

@n0ts
Copy link
Contributor Author

n0ts commented Feb 8, 2018

@jacobbednarz Yes, It's correct.

@jacobbednarz
Copy link
Member

Done! 2.1.1 is released https://rubygems.org/gems/cardboard/versions/2.1.1

@n0ts
Copy link
Contributor Author

n0ts commented Feb 20, 2018

@jacobbednarz Thanks for new cardboard release! CI is passed! Thanks!

@n0ts
Copy link
Contributor Author

n0ts commented Feb 21, 2018

@jacobbednarz Could you merge it? I'll send you next pr support 10.13, thanks.

@@ -15,4 +15,6 @@
source => 'puppet:///modules/brewcask/brew-boxen-cask-install.rb',
mode => '0755',
}

homebrew::tap { 'caskroom/cask': }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really required? This seems odd that it's never broke before?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants