Repository navigation
Expand file tree
/
Copy pathsetup
More file actions
executable file
·54 lines (43 loc) · 1.61 KB
/
Copy pathsetup
File metadata and controls
executable file
·54 lines (43 loc) · 1.61 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# https://github.com/thoughtbot/guides/tree/master/protocol
# Exit if any subcommand fails
set -e
# Set up Ruby dependencies via Bundler
gem install bundler --conservative
bundle check || bundle install
# Set up configurable environment variables
if [ ! -f .env ]; then
cp .sample.env .env
fi
# Set up database and add any development seed data
bundle exec rake db:setup dev:prime
# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
mkdir -p .git/safe
# Pick a port for Foreman
if ! grep --quiet --no-messages --fixed-strings 'port' .foreman; then
printf 'port: 3000\n' >> .foreman
fi
if ! command -v foreman > /dev/null; then
printf 'Foreman is not installed.\n'
printf 'See https://github.com/ddollar/foreman for install instructions.\n'
fi
if ! command -v phantomjs > /dev/null; then
printf 'Phantomjs is not installed.\n'
printf 'See http://phantomjs.org/download.html for install instructions.\n'
fi
# Only if this isn't CI
# if [ -z "$CI" ]; then
# fi
if ! command -v heroku > /dev/null; then
printf 'Heroku is not installed.\n'
printf "You'l need it to contribute to the demo app\n"
printf 'https://devcenter.heroku.com/articles/heroku-cli for install instructions\n'
else
if heroku join --app administrate-prototype > /dev/null 2>&1; then
git remote add staging git@heroku.com:administrate-prototype.git || true
printf 'You are a collaborator on the "administrate-prototype" Heroku app\n'
else
printf 'Ask for access to the "administrate-prototype" Heroku app\n'
fi
fi