Skip to content

Commit 49d916c

Browse files
authored
Fix-brew-step (#453)
* fix brew step
1 parent aa67b23 commit 49d916c

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=v0.0.420
1+
VERSION=v0.0.421
22

33
OUT_DIR=dist
44
YEAR?=$(shell date +"%Y")

build/ci.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,27 @@ steps:
242242
title: bump brew formula version
243243
image: codefresh/build-cli
244244
commands:
245-
- echo "generate formula from template ..."
246-
- sed -e "s/{{ version }}/${{VERSION}}/g" -e "s/{{ revision }}/${{CF_REVISION}}/g" ./brew/template.rb > ${{BREW_NAME}}.rb
247-
- echo "Updating file in GitHub"
248-
- FORMULA_SHA256=$(curl -X GET https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/${{BREW_NAME}}.rb | jq .sha)
249245
- |
250-
curl -v -i -X PUT -H 'Authorization: token '$GITHUB_TOKEN'' -d "{ \
251-
\"message\": \"update formula version $VERSION\", \
252-
\"content\": \"$(openssl base64 -A -in ${{BREW_NAME}}.rb)\", \
253-
\"sha\": $FORMULA_SHA256 \
254-
}" https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/${{BREW_NAME}}.rb
246+
echo "generate formula from template..."
247+
sed -e "s/{{ version }}/${{VERSION}}/g" -e "s/{{ revision }}/${{CF_REVISION}}/g" ./brew/template.rb > ${{BREW_NAME}}.rb
248+
echo "Updating file in GitHub"
249+
FORMULA_SHA256=$(curl -X GET https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/${{BREW_NAME}}.rb \
250+
-H "Authorization: token ${GITHUB_TOKEN}" \
251+
-s | jq .sha)
252+
echo "sha - ${FORMULA_SHA256}"
253+
STATUS_CODE=$(curl -X PUT https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/${{BREW_NAME}}.rb \
254+
-H "Authorization: token ${GITHUB_TOKEN}" \
255+
-d "{ \
256+
\"message\": \"update formula version to ${VERSION}\", \
257+
\"content\": \"$(openssl base64 -A -in ${{BREW_NAME}}.rb)\", \
258+
\"sha\": ${FORMULA_SHA256} \
259+
}" -s -o response -w "%{http_code}")
260+
echo "statusCode - ${STATUS_CODE}"
261+
if [[ "$STATUS_CODE" -ge 300 ]]; then
262+
cat ./response
263+
echo "failed updating brew formula version"
264+
exit 1
265+
fi
255266
when:
256267
steps:
257268
- name: create_release_bin

docs/releases/release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cf version
2323

2424
```bash
2525
# download and extract the binary
26-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.420/cf-linux-amd64.tar.gz | tar zx
26+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.421/cf-linux-amd64.tar.gz | tar zx
2727

2828
# move the binary to your $PATH
2929
mv ./cf-linux-amd64 /usr/local/bin/cf
@@ -36,7 +36,7 @@ cf version
3636

3737
```bash
3838
# download and extract the binary
39-
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.420/cf-darwin-amd64.tar.gz | tar zx
39+
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.421/cf-darwin-amd64.tar.gz | tar zx
4040

4141
# move the binary to your $PATH
4242
mv ./cf-darwin-amd64 /usr/local/bin/cf

manifests/runtime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: "{{ namespace }}"
66
spec:
77
defVersion: 1.0.1
8-
version: 0.0.420
8+
version: 0.0.421
99
bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd
1010
components:
1111
- name: events

0 commit comments

Comments
 (0)