Skip to content

bikebrigade/dispatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI

BikeBrigade

🎬 Project Board

Prerequisities

  1. nix with flakes enabled
  2. docker

Getting an environment set up

  1. Clone this repo
  2. Copy the env file cp .env.local.sample .env.local
  3. Run nix develop inside the directory. This will create an environment that has all the dependencies installed locally. If you don't have flakes enabled, there's a backwards-compatible nix-shell as well.
  4. Inside the nix shell, run docker-compose up -d
  5. Setup everything, run mix bb.init

Development environment

You'll want to be inside the nix-shell when working on this project. Make sure postgres is running with docker-compose up -d

As you develop, when you've downloaded new code, you can run mix setup to update the dependencies and run any migrations.

To start the server & console run:

scripts/server

Note: if you want the Elixir language server to be accessible to your editor, you will have to launch your editor from within the nix-shell, or do some direnv or lorri magic.

Testing

You can run the entire test suite with

scripts/test

If you wish to run a specific test you can provide a file and optionally a line number

scripts/test path/to/test.exs:LINENUMBER

Code formatting

Format code with

scripts/format

There is probably a way to set up your editor to run scripts/format on save. This article may help in a VS Code context.

You can also add mix format --check-formatted to a Git pre-commit hook to have git automatically error on git commit if formatting needs to be applied.

Note: similar to having the Elixir language server available in your editor you may need to launch your editor from within nix-shell or otherwise make sure your editor can find/run scripts/format.

Updating nix dependencies

niv is used to ensure everyone is using the same version of nixpkgs. To update the nixpkgs version run:

nix-shell -p niv
niv update

You can then commit the changes.

Deploying

Staging

Force push to the staging branch in order to deploy to staging

scripts/deploy_staging

Production

Pushes to the main branch (including merged PRs) automatically trigger a production deploy. Please be aware of this when pushing small changes without a PR.

External dependencies

Contributors

This project's history has been squashed as part of open-sourcing, so not all contributions are reflected in the Git history.

Please see CONTRIBUTORS.md for the list of contributors.

License

Copyright 2021 The Bike Brigade Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.