Skip to content

Commit

Permalink
Initial untested work toward automating brew recipe update also.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Oct 19, 2015
1 parent e149119 commit 4d6f7d9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ docs/_build
.venv

tool_test_output.*

# Used by build process to push updated brew formula.
homebrew-tap
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ new-version:

release: commit-version release-aritfacts new-version

release-brew:
bash scripts/update_planemo_recipe.bash $(VERSION)

push-release:
git push $(UPSTREAM) master
git push --tags $(UPSTREAM)
Expand Down
2 changes: 1 addition & 1 deletion docs/developing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ are fine.
* ``make clean && make lint && make test``
* ``make release VERSION=<old_version> NEW_VERSION=<new_version>``
* ``make push-release``
* Update planemo homebrew recipe to new version.
* ``make release-brew VERSION=<old_version>`` (Update planemo homebrew recipe to new version, this works if no new requirements have been added.)
27 changes: 27 additions & 0 deletions scripts/update_planemo_recipe.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

HOMEBREW_TAP="galaxyproject/homebrew-tap"
VERSION=$1
shift

if[ -d homebrew-tap ];
then
git clone git@github.com:$HOMEBREW_TAP.git homebrew-tap
fi
cd homebrew-tap

brew uninstall planemo
sed -E -i "s/planemo-([0-9]+)\.([0-9]+)\.([0-9]+)\.tar\.gz/planemo-$VERSION.tar.gz/" planemo.rb
sed -i "s/^ sha256.*$/ sha256 \"\"/" planemo.rb
brew install planemo.rb > output
#For your reference the SHA256 is: efc829aa1c579c5d8cace3a3da46284aa1a78fbec80f3a5a31a73e08f5d2bc6e
sha_line=`awk '/For your reference the SHA256 is:/' output`
echo "sha_line is $sha_line"
IFS=" " read -a sha_line_array <<< "$sha_line"
sha=${sha_line_array[6]}
echo "Updating SHA256 to $sha"
sed -i "s/^ sha256.*$/ sha256 \"$sha\"/" planemo.rb

git add planemo.rb
git commit -m "Rev planemo to version $VERSION"
git push

0 comments on commit 4d6f7d9

Please sign in to comment.