Skip to content

Commit

Permalink
Merge pull request #93 from pulibrary/readme-structure
Browse files Browse the repository at this point in the history
Reorganize readme a bit for creater clarity
  • Loading branch information
tpendragon authored Sep 24, 2024
2 parents 6ea969d + f455319 commit 356a4b2
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
# DpulCollections

To run the development database type: `lando start`
## Project Setup for Development and Test environments

To start your Phoenix server:
### Every time setup

* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
Do these things every time you start new work in this project in dev or test

- `$ lando start` will run the test and dev database and index services
- `mix setup` will install and setup dependencies

### Development environment

- `mix phx.server` will start the phoenix endpoint
- or `iex -S mix phx.server` will start the phoenix endpoint inside IEx

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
### Running Tests

## Running Tests
- `mix test` will run all the test suite
- after tests are run, `./cover` will contain coverage data

`mix test`
## Occasional tasks for Development and Test environments

This will run all your tests and store your coverage data in `./cover`.
### Figgy Fixtures

## Checking Formatting
We copy fixtures from Figgy's production database into a Docker container so that we can easily use it for testing indexing. To rebuild that container:

`mix format` will format your code
`mix format --check-formatting` will tell you formatting that must be done.
- `brew install lastpass-cli`
- `cd figgy-fixture-container && ./build-and-push.sh`

## Build & Run Production Docker Image Locally
## Code contributions

Build Docker Image: `docker build . -t dpul-collections`
Remember to check formatting before pushing commits.

The SECRET_KEY_BASE below is just a filler one for the purpose of testing locally.
- `mix format` will format your code
- `mix format --check-formatting` will tell you formatting that must be done.

Run Docker Image: `docker run -t -p 4000:4000 -e DATABASE_URL='ecto://postgres:@host.docker.internal:5434/database' -e SECRET_KEY_BASE='B8rwzeX3DFLveiJ4cP28lRGc0PWdEr8ZF/hDoPRucw95Nzf2IPnu7lhEB+Yldx6Z' dpul-collections`
## Production tasks

## Deployment
### Deployment

1. Connect to VPN
1. `BRANCH=<branch> ./bin/deploy staging`

## Connecting to Staging Shell or IEX Console
### Connecting to Staging Shell or IEX Console

1. Connect to VPN
1. `./bin/console staging [bash/repl]`

## Figgy Fixtures

We copy fixtures from Figgy's production database into a Docker container so that we can easily use it for testing indexing. To rebuild that container:
### Build & Run Production Docker Image Locally

`brew install lastpass-cli`
`cd figgy-fixture-container && ./build-and-push.sh`
Build Docker Image: `docker build . -t dpul-collections`

## Learn more
The SECRET_KEY_BASE below is just a filler one for the purpose of testing locally.

* Official website: https://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Forum: https://elixirforum.com/c/phoenix-forum
* Source: https://github.com/phoenixframework/phoenix
Run Docker Image: `docker run -t -p 4000:4000 -e DATABASE_URL='ecto://postgres:@host.docker.internal:5434/database' -e SECRET_KEY_BASE='B8rwzeX3DFLveiJ4cP28lRGc0PWdEr8ZF/hDoPRucw95Nzf2IPnu7lhEB+Yldx6Z' dpul-collections`

0 comments on commit 356a4b2

Please sign in to comment.