Skip to content

Commit 0b2e80a

Browse files
committed
Add quickstart script for Codespaces environment
1 parent 5868eff commit 0b2e80a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

bin/setup-codespaces

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ -z "$ZSH_VERSION" ] && [ -z "$BASH_VERSION" ]; then
6+
echo "This script must be sourced. Please run with 'source bin/setup-codespaces'."
7+
exit 1;
8+
fi
9+
10+
rvm install $(cat .ruby-version)
11+
rvm --default use $(cat .ruby-version)
12+
ruby -v
13+
14+
docker run -d -i --name postgres -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres
15+
export DATABASE_URL=postgresql://postgres:@localhost
16+
17+
# Create config/database.yml
18+
./bin/setup
19+
# Setup & Create .env
20+
./bin/setup
21+
RAILS_ENV=test bundle exec rake db:setup dev:prime
22+
23+
echo "" >> .env && echo "DATABASE_URL=postgresql://postgres:@localhost" >> .env

0 commit comments

Comments
 (0)