Skip to content

Commit 492b599

Browse files
authored
Merge pull request #118 from codefresh-io/homebrew
Update Codefresh Homebrew formula
2 parents 1ce3805 + cd08fdf commit 492b599

File tree

6 files changed

+74
-2
lines changed

6 files changed

+74
-2
lines changed

brew/template.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Codefresh < Formula
2+
desc "Codefresh CLI provides a full and flexible interface to interact with Codefresh."
3+
homepage "http://cli.codefresh.io"
4+
url "https://github.com/codefresh-io/cli/releases/download/{{ VERSION }}/codefresh-{{ VERSION }}-macos-x64.tar.gz"
5+
version "{{ VERSION }}"
6+
sha256 "{{ SHA256 }}"
7+
8+
def install
9+
bin.install "codefresh"
10+
end
11+
12+
test do
13+
system "#{bin}/codefresh version"
14+
end
15+
end

codefresh-release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,21 @@ steps:
106106
- 'cd public && git add --all && git commit -m "Publish new documentation for version ${{PACKAGE_VERSION}}" && git push https://${{GITHUB_TOKEN}}@github.com/codefresh-io/cli.git'
107107
environment:
108108
- HUGO_VERSION=0.32.0
109+
110+
update_brew_formula:
111+
title: "Updating homebrew formula"
112+
image: codefresh/cli-build
113+
commands:
114+
- VERSION=v${{PACKAGE_VERSION}}
115+
- curl -L https://github.com/codefresh-io/cli/releases/download/$VERSION/codefresh-$VERSION-macos-x64.tar.gz > $VERSION.tar.gz
116+
- echo "compute SHA256 ..."
117+
- SHA256="$(shasum -a 256 ./$VERSION.tar.gz | awk '{print $1}')"
118+
- echo "generate file from template ..."
119+
- sed -e "s/{{ VERSION }}/$VERSION/g" -e "s/{{ SHA256 }}/$SHA256/g" ./brew/template.rb > codefresh.rb
120+
- echo "Updating file in GitHub"
121+
- |
122+
curl -v -i -X PUT -H 'Authorization: token '${{COMMIT_TOKEN}}'' -d "{ \
123+
\"message\": \"update formula version $VERSION\", \
124+
\"content\": \"$(openssl base64 -A -in codefresh.rb)\", \
125+
\"sha\": $(curl -X GET https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/codefresh.rb | jq .sha) \
126+
}" https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/codefresh.rb

codefresh.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,13 @@ steps:
4646
when:
4747
branch:
4848
only: [ master ]
49+
50+
update_homebrew_formula:
51+
title: "Update Homebrew formula in case version was changed"
52+
image: codefresh/cli
53+
fail_fast: false
54+
commands:
55+
- "echo Updating Homebrew formula && codefresh run 5a6f1c9804e70e0001b3acad -b=master --detach"
56+
when:
57+
branch:
58+
only: [ master ]

docs/content/installation/homebrew.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
+++
2+
title = "HOMEBREW"
3+
description = "Homebrew install"
4+
date = "2018-01-30T12:00:00+02:00"
5+
weight = 20
6+
+++
7+
8+
Install Codefresh CLI on macOS with [Homebrew](https://brew.sh).
9+
10+
## Install
11+
12+
```sh
13+
# tap Codefresh homebrew repo
14+
brew tap codefresh-io/cli
15+
# install Codefresh CLI
16+
brew install codefresh
17+
```
18+
19+
## Update to the latest version
20+
21+
```sh
22+
brew upgrade codefresh
23+
```
24+
25+
## Uninstall
26+
27+
```sh
28+
brew uninstall codefresh
29+
```

docs/content/installation/npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date = "2017-04-24T18:36:24+02:00"
55
weight = 10
66
+++
77

8-
{{% alert theme="warning" %}}the CLI requires node version 8.0.0 or higer{{% /alert %}}
8+
{{% alert theme="warning" %}}the CLI requires node version 8.0.0 or higher{{% /alert %}}
99

1010
Codefresh's CLI is available for installation through NPM registry.
1111

docs/content/installation/yarn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date = "2017-04-24T18:36:24+02:00"
55
weight = 20
66
+++
77

8-
{{% alert theme="warning" %}}the CLI requires node version 8.0.0 or higer{{% /alert %}}
8+
{{% alert theme="warning" %}}the CLI requires node version 8.0.0 or higher{{% /alert %}}
99

1010
Codefresh's CLI is available for installation using YARN.
1111

0 commit comments

Comments
 (0)