Skip to content

kigster/makeabox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

281 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Makeabox — Rails Application

Unit Tests

This is the makeabox application that generates laser-cut path as a downloadable PDF file.

INFO: It’s recently been upgraded to use Rails 7.1 under the hood.

1. Prerequisites

Assuming you develop on OS-X, it should be pretty trivial to get MakeABOX runnign locally using the provided Makefile:

 make help

  brew          Installs Homebrew if on OS-X
  bundle        Run the local test suite
  deploy-quick  Deploy makeabox to production using Capistrano, skips tests and git status
  deploy        Deploy makeabox to production using Capistrano
  git-status    Ensures the local repo is clean
  help          Prints help message auto-generated from the comments.
  lint-fix-all  Runs rubocop with a more dangerous auto-correct
  lint-fix      Runs rubocop with auto-correct
  lint          Runs rubocop
  pre-commit    Runs rspec and rubocop before the commit
  ruby          Installs Ruby if needed
  test          Run the local test suite

1.1. Setup

If you don’t have make in your system, you should run xcode-select --install to install the XCode command line tools, which will install make for you, as well as git.

After that, you can try running:

make test

Running RSpecs via the Makefile depends on having bundle install ran, which in turn depends on having Ruby installed.

Ruby is installed via rbenv, which is installed via brew on OS-X, and via apt on Linux.

Finally, make pre-commit will run both specs and rubocop to ensure your changes are green on CI.

2. Run the App Locally

To run the app locally, run it via make:

make puma

This should start Puma, and open a browser window to https://localhost:3000/ where you can see the app running.

You can also start puma via:

❯ bin/puma-start

3. Deploying

3.1. Prerequisites

Before the next step, you need to have the private SSH key that Amazon gave you for your account, so that you can login as the user ubuntu and essentially — root.

Place this PEM file into a specific location: ${HOME}/.ssh/makeabox.pem and everything else will be easy.

3.2. Automatic Deploy

Deploy is provided with Capistrano.

make deploy

OR, if you have locally modified changes you don’t want to check in yet, then:

make deploy-quick

3.3. Manual Deploy

You can, of course, drive Capistrano by hand:

bundle exec cap production deploy --trace

About

MakeABox – use this app with a laser cutter to create a box with notches that connect all sides together.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors