compile-build
#!/bin/bash
set -e
export NODE_ENV=production
export RAILS_ENV=production
echo 'Updating yarn'
bundle exec yarn
echo 'Cleaning up'
bundle exec rake assets:clobber
echo 'Compiling assets'
bundle exec rake assets:precompile
echo 'Generating sha'
echo ${1:-$(git rev-parse HEAD)} > REVISION
echo ${2:-$(git tag -l --points-at HEAD --sort -version:refname | head -1)} > TAG
echo ${3:-$(git rev-parse --abbrev-ref HEAD)} > BRANCH
echo 'Compiling tar.gz'
tar \
--exclude='*.swp' \
--exclude='./.bundle' \
--exclude='./.git' \
--exclude='./.gitignore' \
--exclude='./.rspec' \
--exclude='./.rubocop*' \
--exclude='./.tags' \
--exclude='./.travis.yml' \
--exclude='./README*' \
--exclude='./compile-build' \
--exclude='./coverage' \
--exclude='./*.sublime-project' \
--exclude='./log/*' \
--exclude='./node_modules' \
--exclude='./spec' \
--exclude='./tmp' \
--exclude='./vendor/bundle' \
--exclude='release.tar.gz' \
-zcvf /tmp/release.tar.gz ./
mv /tmp/release.tar.gz ./release.tar.gz
echo 'Release complete!'
echo `pwd`/release.tar.gz