Merge pull request #989 from WillPlatnick/brew_docs

Add brew install documentation
This commit is contained in:
Kris Childress 2016-12-04 06:00:26 -07:00 committed by GitHub
commit 7242d91e24
4 changed files with 76 additions and 6 deletions

View File

@ -42,6 +42,16 @@ Download the [latest release](https://github.com/kubernetes/kops/releases/latest
View our [changelog](HISTORY.md)
### From Homebrew (Latest Stable Release)
```
brew update && brew install kops
```
### From Homebrew (HEAD of master)
```
brew update && brew install --HEAD kops
```
### From Source
```

View File

@ -0,0 +1,25 @@
# Releasing kops to Brew
Submitting a new release of kops to Homebrew is very simple.
### From a homebrew machine
```brew edit kops``` will open an editor on your machine to edit the formula. Make the following changes:
* Update the URL variable to the tar.gz of the new release source code
* Update the sha256 variable to SHA256 checksum of the new tar.gz
**If we change how dependencies work or if we make the install require something other than a simple make, we'll need to update the commands**
### Test that Homebrew formula works
```brew uninstall kops && brew install kops``` will install the new version. Test and make sure that the new release works.
### Audit the Homebrew formula
```brew audit --strict --online``` will output any code that that doesn't meet the Homebrew standards.
### Send a commit to the Homebrew repo
Rather than repeating documentation that might change, head over to [Homebrew documentation](https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md#commit) for directions and conventions.
The formula can be found in hacks/brew/kops.rb.

View File

@ -6,3 +6,8 @@ Update the latest source code from kubernetes/kops
cd ${GOPATH}/src/k8s.io/kops/
git pull && make
```
Alternatively, if you installed from Homebrew
```
brew update && brew upgrade kops
```

30
hack/brew/kops.rb Normal file
View File

@ -0,0 +1,30 @@
class Kops < Formula
desc "Production Grade K8s Installation, Upgrades, and Management"
homepage "https://github.com/kubernetes/kops"
url "https://github.com/kubernetes/kops/archive/v1.4.1.tar.gz"
sha256 "69b3c9d7e214109cfd197031091ed23963383c894e92804306629f6a32ab324b"
head "https://github.com/kubernetes/kops.git"
bottle do
cellar :any_skip_relocation
sha256 "99fc900bb11b242b4d3eca456fc7956233a8efa92f3dee7b321a005de0e94a28" => :sierra
sha256 "ed71d71b5031e0918478dec06b9064cf7e3f5b907128e98ec85a187801a27f8e" => :el_capitan
sha256 "0eee45caca5eb2a67ab88a90f9da226e99538d5198a196067b2a224a816bd6e0" => :yosemite
end
depends_on "go" => :build
depends_on "kubernetes-cli"
def install
ENV["VERSION"] = version unless build.head?
ENV["GOPATH"] = buildpath
kopspath = buildpath/"src/k8s.io/kops"
kopspath.install Dir["*"]
system "make", "-C", kopspath
bin.install("bin/kops")
end
test do
system "#{bin}/kops", "version"
end
end