We use the "Scripts To Rule Them All" pattern to standardise the common commands we have to use.
Setup the application:
$ script/setup
Start the server:
$ script/server
Start a console:
$ script/console
Run the tests:
$ script/test
Update application to run for its current checkout:
$ script/update
Docker is made available to run these commands locally as containerisation MUST be used on CI and SHOULD be used on live environments. Using Docker locally provides the strongest parity between development and live. It can also be more stable to get running on your machine.
Running the tests regularly should be done without Docker as it is much faster.
$ brew install --cask docker
Use the --docker
switch:
$ script/test --docker
You can set PREFER_DOCKER_FOR_DXW_RAILS=1
in your env to set this preference
automatically.
- Option 1:
- Install and use direnv to set an environment variable on a per codebase basis
- Add
PREFER_DOCKER_FOR_DXW_RAILS=1
to your.envrc
- Load change with
direnv allow .
- Option 2:
- Set
PREFER_DOCKER_FOR_DXW_RAILS=1
in your global.zshrc
or.bashrc
- Load your change with
source .zshrc
- Set
Switches will take priority over any default preference. For example, with
PREFER_DOCKER_FOR_DXW_RAILS=1
set you can run --no-docker
to run without
Docker.