Skip to content

Commit df295a5

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

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

bin/setup-codespaces

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
./bin/setup
18+
./bin/setup
19+
RAILS_ENV=test bundle exec rake db:setup dev:prime
20+
21+
echo "" >> .env && echo "DATABASE_URL=postgresql://postgres:@localhost" >> .env

0 commit comments

Comments
 (0)