Skip to content

Commit

Permalink
Update scripts for hybrid setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalcymerys committed Jan 16, 2023
1 parent c2e5bcd commit 31c56e4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ docker-compose up
#### Run setup script

```bash
bin/start-hybrid
bin/setup-hybrid
```

After loading all docker dependencies launch local server with:

```bash
bin/rails s
bin/start-hybrid
```

#### (Optional) Import sample data such as products, categories, etc

```bash
docker-compose run web rake spree_sample:load
bundle exec rake spree_sample:load
```

### Without Docker (not recommended for beginners)
Expand Down
15 changes: 15 additions & 0 deletions bin/setup-hybrid
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -o errexit

export DB_HOST=127.0.0.1
export DB_PORT=5432

rm -rf .env
cp -f .env.sample .env
bin/start-dependency-containers
(bundle check || bundle install)
bundle exec rails db:drop
bundle exec rails db:create
bundle exec rails db:migrate
bundle exec rails db:seed
rm -rf tmp/latest.dump
6 changes: 6 additions & 0 deletions bin/start-dependency-containers
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -o errexit

docker-compose up -d redis postgres
bin/wait-for-services
11 changes: 9 additions & 2 deletions bin/start-hybrid
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
bin/setup &&
docker-compose up redis postgres
#!/bin/bash
set -o errexit

export DB_HOST=127.0.0.1
export DB_PORT=5432

bin/start-dependency-containers

bundle exec rails server

0 comments on commit 31c56e4

Please sign in to comment.