Skip to content

Commit

Permalink
remove commit from update script (#783)
Browse files Browse the repository at this point in the history
* remove commit and token from update script
* push only on master

Signed-off-by: Ramiro Berrelleza <rberrelleza@gmail.com>
  • Loading branch information
rberrelleza committed Mar 25, 2020
1 parent 6bda277 commit 29a14cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
name: "Update brew formula"
command: |
sha=$(cat ./artifacts/bin/okteto-Darwin-x86_64.sha256 | awk '{print $1}')
bash ./update_homebrew_formula.sh 0.0.1 $GITHUB_TOKEN $sha 1
./update_homebrew_formula.sh 0.0.1 $sha
windows-unit:
environment:
OKTETO_USER: cindylopez
Expand Down Expand Up @@ -171,7 +171,9 @@ jobs:
name: "Update brew formula"
command: |
sha=$(cat ./artifacts/bin/okteto-Darwin-x86_64.sha256 | awk '{print $1}')
bash ./update_homebrew_formula.sh $CIRCLE_TAG $GITHUB_TOKEN $sha 0
./update_homebrew_formula.sh $CIRCLE_TAG $sha
pushd homebrew-cli
git push https://${GITHUB_TOKEN}@github.com/okteto/homebrew-okteto.git master
release-master:
docker:
- image: circleci/golang:1.14
Expand Down
20 changes: 3 additions & 17 deletions update_homebrew_formula.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
set -e

VERSION=$1
GITHUB_TOKEN=$2
SHA=$3
DRYRUN=$4
SHA=$2

if [ -z "$VERSION" ]; then
echo "missing version"
Expand All @@ -16,14 +14,8 @@ if [ -z "$SHA" ]; then
exit 1
fi

if [ -z "$GITHUB_TOKEN" ]; then
echo "missing github token"
exit 1
fi

pushd $(mktemp -d)

git clone --depth 1 https://${GITHUB_TOKEN}@github.com/okteto/homebrew-cli.git
rm -rf homebrew-cli
git clone --depth 1 https://github.com/okteto/homebrew-cli.git
pushd homebrew-cli

cat << EOF > Formula/okteto.rb
Expand Down Expand Up @@ -57,9 +49,3 @@ git config user.email "ci@okteto.com"
git commit -m "$VERSION release"
git --no-pager log -1

if [ "$DRYRUN" -eq "1" ]; then
echo "dry run: git push origin master"
else
git push https://${GITHUB_TOKEN}@github.com/okteto/homebrew-okteto.git master
fi

0 comments on commit 29a14cc

Please sign in to comment.