Giter Site home page Giter Site logo

bencoppock / scheduler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fosterful/scheduler

0.0 1.0 0.0 1.2 MB

Scheduling app

Home Page: http://app.officemomsanddads.com

Ruby 67.08% JavaScript 11.95% CSS 7.69% HTML 12.16% Shell 0.66% Dockerfile 0.45%

scheduler's Introduction

Office Moms and Dads Scheduler

Maintainability Test Coverage Join the chat at https://gitter.im/office-moms-and-dads/community

Development Environment Setup

  1. Download Docker CE for Mac

Note: remove boot2docker or other Docker implementations if any were previously installed

  1. Copy the env.example file to .env cp env.example .env

    Note: There exists a .env file in 1Password intended for development. Note: On Mac, make sure to append :docker-compose.mac.yml to COMPOSE_FILE to take advantage of cached volumes

  2. Run docker-compose up

  3. Open a browser to localhost:3000 verify the app is up.

Helpful Docker Commands

  • docker-compose up Starts fresh containers -d starts it in daemon mode
  • docker-compose down Stops and removes containers(all data too)
  • docker-compose stop Stops running containers but persists data
  • docker-compose start Starts containers with persisted data
  • docker system prune Cleans up unused containers, networks, and images -a removes all

Note: it is recommended to run the clean up commands weekly

  • docker ps Lists all running containers
  • docker-compose run app bash Starts a bash session on app, bringing up only dependent services.
  • docker exec -it ID_FROM_DOCKER_PS bash. Connects another bash session to a running container.
  • docker attach ID_FROM_DOCKER_PS Attach is useful for pry debugging in a running container

Note: To detach use ctrl-p + ctrl-q

Rails Commands in a Docker World

Now that the app is running in Docker we will run all Rails and Rake commands in the container.

Here are a few examples:

Note: this is expecting the containers are up

  • docker-compose exec app bundle exec rake db:migrate
  • docker-compose exec app bundle exec rails c

The pattern is docker-compose exec (container_name) rails or rake command. This pattern works for non-Rails commands also.

  • docker-compose exec app bash will open the terminal on the container

System Tests

System tests open the browser and make assertions against the content of the page or verify expected behavior. These tests can be run in headless mode (the default), which means that they are executed in a virtual browser. If you would like them to be run in an actual, viewable browser, you will need to disable headless mode by setting the HEADLESS environment variable to 'false' and ensure you have the ChromeDriver WebDriver downloaded and installed on your host machine.

E.g. HEADLESS=false bundle exec rspec spec/system/mytest_spec.rb

If you are running in non-headless mode, you'll need to be sure you have the ChromeDriver running and able to accept connections from the IP the server is running on. This can be done by running ChromeDriver in a separate tab/console via:

./chromedriver --whitelisted-ips

scheduler's People

Contributors

benjaminwood avatar danielpclark avatar dinjas avatar gitter-badger avatar kyleboe avatar natevick avatar nshoes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.