Skip to content

Commit

Permalink
Fixes conflict in describing docker-compose problems
Browse files Browse the repository at this point in the history
- removes troubleshooting log text

Merge branch 'develop' of https://github.com/RefugeRestrooms/refugerestrooms into develop
  • Loading branch information
lisavogtsf committed Apr 4, 2019
2 parents 7c6ee36 + 7aaf380 commit 5eba40b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
41 changes: 36 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ _(Older Mac or Windows PC? See [instructions for Docker Toolbox](https://github.

_(Running Linux? See [instructions for Docker CE on Linux](https://github.com/RefugeRestrooms/refugerestrooms/wiki/How-to-use-Docker-CE-on-Linux-with-Refuge-Restrooms).)_

### 3 Build the Docker Container
Build the container from any [terminal](https://github.com/RefugeRestrooms/refugerestrooms/wiki/What-is-a-Terminal-(or-%22Terminal-Emulator%22)%3F-How-do-I-run-text-based-commands-on-my-computer%3F) program with:
### 3 Build the Docker Containers
Build the containers from any [terminal](https://github.com/RefugeRestrooms/refugerestrooms/wiki/What-is-a-Terminal-(or-%22Terminal-Emulator%22)%3F-How-do-I-run-text-based-commands-on-my-computer%3F) program with:
```
docker-compose build
```

### 4 Run the Docker Container
Optional: list the containers you just built:
```
docker ps
```

You should see two containers: refugerestrooms_web and postgres.

### 4 Run the Docker Containers

You can now run the app with:
```
Expand All @@ -40,16 +47,40 @@ If you need to run commands on the Docker container directly, run this:
```
docker-compose run web bash
```
_(This will give you a full interactive terminal session running on the Docker machine. You can (for example) run `bundle update` to update the Gems in the Gemfile to more recent versions.)_
_(This will give you a full interactive terminal session running on the Docker machine. For example, run `bundle update` to update the Gems in the Gemfile to more recent versions, or `rails console` to access web objects like `Restroom.first`.)_

Occasionally, you might need to rebuild the Docker machine so it picks up major updates (such as a new version of Ruby, or an updated Gemfile). To do so, run `docker-compose down` and `docker-compose build`.

If you want to access the postgres container to reach the psql command line do

```
docker-compose run db bash
psql -h refugerestrooms_db_1 -U postgres
```

or equivalently:
```
docker-compose run db psql -h refugerestrooms_db_1 -U postgres
```

### 6 Run the Tests
```
docker-compose run -e "RAILS_ENV=test" web rake db:test:prepare spec
docker-compose run -e "RAILS_ENV=test" web rake db:migrate:reset spec
```
_(If you want to know if your changes pass our automated testing, before even submitting your changes to RefugeRestrooms on Github, this will let you know.)_

If you want to run an individual spec, first log in to the container, then the spec. E.g.:
```
docker-compose run web bash
rspec spec/models/restroom_spec.rb
```

This is equivalent, but slower during a code-test-code-test development cycle:

```
docker-compose run web rspec spec/models/restroom_spec.rb
```

### 7 Shut down the Docker Container:
In another terminal window, run:
```
Expand Down
1 change: 0 additions & 1 deletion app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Users::RegistrationsController < Devise::RegistrationsController

# POST /resource
def create
puts "**********************************************************"
super
UserMailer.approve_new_user_email(@user).deliver_now
end
Expand Down

1 comment on commit 5eba40b

@lisavogtsf
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should resolve the literal git merge conflict that was happening in CONTRIBUTING.md

Please sign in to comment.