-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcompile-build
More file actions
executable file
·37 lines (36 loc) · 1.02 KB
/
compile-build
File metadata and controls
executable file
·37 lines (36 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e # Exit immediately if something fails
export NODE_ENV=production
export RAILS_ENV=development
echo 'Install npm dependencies'
npm install
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='./.tags' \
--exclude='./README*' \
--exclude='./compile-build' \
--exclude='./coverage' \
--exclude='./log/*' \
--exclude='./node_modules' \
--exclude='./spec' \
--exclude='./test' \
--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