Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 67 lines (50 sloc) 1.1 KB
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
declare pwd=$PWD
declare cache="$pwd/vendor/cache"
cleanup() {
./script/teardown
}
bundle_package() {
bundle package --all
echo ""
}
install_hanami_frameworks() {
declare -a frameworks=(utils validations router helpers model view controller mailer assets)
for framework in "${frameworks[@]}"
do
local directory=($cache/$framework-*)
pushd $directory > /dev/null
find . -name \*.gem -delete
gem build hanami-$framework.gemspec > /dev/null
local pkg=(hanami-$framework-*.gem)
gem install $pkg > /dev/null
mv $pkg $cache
echo "Installed $pkg (from $directory)"
popd > /dev/null
done
echo ""
}
install_hanami() {
bundle exec rake build
local pkg=($pwd/pkg/hanami-*.gem)
gem install $pkg > /dev/null
mv $pkg $cache
echo "Installed $pkg (from $(git rev-parse HEAD))"
echo ""
}
generate_index() {
pushd $cache > /dev/null
gem generate_index
popd > /dev/null
echo ""
}
main() {
cleanup &&
bundle_package &&
install_hanami_frameworks &&
install_hanami &&
generate_index
}
main