Repository navigation
Expand file tree
/
Copy pathsetup
More file actions
executable file
·56 lines (44 loc) · 1.61 KB
/
Copy pathsetup
File metadata and controls
executable file
·56 lines (44 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
55
#!/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
# Only if this isn't CI
# if [ -z "$CI" ]; then
# fi
# Set up the staging and production apps.
if heroku join --app administrate-prototype-staging &> /dev/null; then
git remote add staging git@heroku.com:administrate-prototype-staging.git || true
printf 'You are a collaborator on the "administrate-prototype-staging" Heroku app
'
else
printf 'Ask for access to the "administrate-prototype-staging" Heroku app
'
fi
if heroku join --app administrate-prototype-production &> /dev/null; then
git remote add production git@heroku.com:administrate-prototype-production.git || true
printf 'You are a collaborator on the "administrate-prototype-production" Heroku app
'
else
printf 'Ask for access to the "administrate-prototype-production" Heroku app
'
fi