Skip to content

Commit

Permalink
Merge pull request #148 from CircleCI-Public/reset-homebrew
Browse files Browse the repository at this point in the history
[CIRCLE-14156] Homebrew deploy should bump from latest version
  • Loading branch information
Zachary Scott authored Oct 5, 2018
2 parents a631498 + 2faa9ca commit 86401fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .circleci/brew-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e

# Remove the original circleci-agent from /usr/local/bin for homebrew
rm /usr/local/bin/circleci
# Install the latest circleci from homebrew
brew install circleci

VERSION=$(./dist/darwin_amd64/circleci version)
TAG="v$(ruby -e "puts '$VERSION'.split('+')[0]")"
REVISION=$(git rev-parse "$(ruby -e "puts '$VERSION'.split('+')[1]")")
echo "Bumping circleci to $TAG+$REVISION"
brew bump-formula-pr --strict \
--tag="$TAG" \
--revision="$CIRCLE_SHA1" \
circleci

10 changes: 1 addition & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,7 @@ jobs:
git config --global user.email "$GH_EMAIL" > /dev/null 2>&1
git config --global user.name "$GH_NAME" > /dev/null 2>&1
- run: brew --version
- run: |
export VERSION=$(./dist/darwin_amd64/circleci version)
export TAG=v$(ruby -e "puts '$VERSION'.split('+')[0]")
export REVISION=$(git rev-parse $(ruby -e "puts '$VERSION'.split('+')[1]"))
echo "Bumping circleci to $TAG+$REVISION"
brew bump-formula-pr --strict \
--tag=$TAG \
--revision=$CIRCLE_SHA1 \
circleci
- run: ./.circleci/brew-deploy.sh

workflows:
version: 2
Expand Down

0 comments on commit 86401fe

Please sign in to comment.