Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme makefile updates #623

Merged
merged 3 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 10 additions & 59 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!make

# ------------------------------------------------------------------------------
# Makefile -- BioHubBC
# Makefile -- SIMS
# ------------------------------------------------------------------------------

-include .env
Expand All @@ -10,7 +10,7 @@
export $(shell sed 's/=.*//' .env)

.DEFAULT : help
.PHONY : setup close clean build run run-debug build-backend run-backend run-backend-debug build-web run-web run-web-debug database app api db-setup db-migrate db-rollback n8n-setup n8n-export clamav install test lint lint-fix format help
.PHONY : setup close clean build-backend run-backend build-web run-web database app api db-setup db-migrate db-rollback n8n-setup n8n-export clamav install test lint lint-fix format help

## ------------------------------------------------------------------------------
## Alias Commands
Expand All @@ -19,22 +19,14 @@ export $(shell sed 's/=.*//' .env)

# Running the docker build
# 1. Run `make env`
# 2. Edit the `.env` file as needed to update variables and secrets
# 3. Run `make local` or `make local-debug`
# 2. Edit the `.env` file as needed to update variables and secrets
# 3. Run `make web`

env: | setup ## Copies the default ./env_config/env.docker to ./.env

all: | close build run ## Performs all commands necessary to run all projects in docker
all-debug: | close build run-debug ## Performs all commands necessary to run all projects in docker in debug mode

postgres: | close build-postgres run-postgres ## Performs all commands necessary to run the postgres db project in docker
postgres-debug: | close build-postgres run-postgres-debug ## Performs all commands necessary to run the postgres db project in docker in debug mode

backend: | close build-backend run-backend ## Performs all commands necessary to run all backend projects in docker
backend-debug: | close build-backend run-backend-debug ## Performs all commands necessary to run all backend projects in docker in debug mode

web: | close build-web run-web ## Performs all commands necessary to run all backend+web projects in docker
web-debug: | close build-web run-web-debug ## Performs all commands necessary to run all backend+web projects in docker in debug mode
postgres: | close build-postgres run-postgres ## Performs all commands necessary to run the postgres project (db) in docker
backend: | close build-backend run-backend ## Performs all commands necessary to run all backend projects (db, api) in docker
web: | close build-web run-web ## Performs all commands necessary to run all backend+web projects (db, api, app, n8n) in docker

db-setup: | build-db-setup run-db-setup ## Performs all commands necessary to run the database migrations and seeding
db-migrate: | build-db-migrate run-db-migrate ## Performs all commands necessary to run the database migrations
Expand Down Expand Up @@ -67,32 +59,9 @@ clean: ## Closes and cleans (removes) all project containers
@echo "==============================================="
@docker-compose -f docker-compose.yml down -v --rmi all --remove-orphans

## ------------------------------------------------------------------------------
## Build/Run Backend+Frontend Commands
## - Builds all of the biohub projects (db, db_setup, api, app)
## ------------------------------------------------------------------------------

build: ## Builds all project containers
@echo "==============================================="
@echo "Make: build - building all project images"
@echo "==============================================="
@docker-compose -f docker-compose.yml build

run: ## Runs all project containers
@echo "==============================================="
@echo "Make: run - running all project images"
@echo "==============================================="
@docker-compose -f docker-compose.yml up -d

run-debug: ## Runs all project containers in debug mode, where all container output is printed to the console
@echo "==============================================="
@echo "Make: run-debug - running all project images in debug mode"
@echo "==============================================="
@docker-compose -f docker-compose.yml up

## ------------------------------------------------------------------------------
## Build/Run Postgres DB Commands
## - Builds all of the biohub postgres db projects (db, db_setup)
## - Builds all of the SIMS postgres db projects (db, db_setup)
## ------------------------------------------------------------------------------

build-postgres: ## Builds the postgres db containers
Expand All @@ -107,15 +76,9 @@ run-postgres: ## Runs the postgres db containers
@echo "==============================================="
@docker-compose -f docker-compose.yml up -d db db_setup

run-postgres-debug: ## Runs the postgres db containers in debug mode, where all container output is printed to the console
@echo "==============================================="
@echo "Make: run-postgres-debug - running postgres db images in debug mode"
@echo "==============================================="
@docker-compose -f docker-compose.yml up db db_setup

## ------------------------------------------------------------------------------
## Build/Run Backend Commands
## - Builds all of the biohub backend projects (db, db_setup, api)
## - Builds all of the SIMS backend projects (db, db_setup, api)
## ------------------------------------------------------------------------------

build-backend: ## Builds all backend containers
Expand All @@ -130,15 +93,9 @@ run-backend: ## Runs all backend containers
@echo "==============================================="
@docker-compose -f docker-compose.yml up -d db db_setup api

run-backend-debug: ## Runs all backend containers in debug mode, where all container output is printed to the console
@echo "==============================================="
@echo "Make: run-backend-debug - running backend images in debug mode"
@echo "==============================================="
@docker-compose -f docker-compose.yml up db db_setup api

## ------------------------------------------------------------------------------
## Build/Run Backend+Web Commands (backend + web frontend)
## - Builds all of the biohub backend+web projects (db, db_setup, api, app, n8n, n8n_nginx, n8n_setup)
## - Builds all of the SIMS backend+web projects (db, db_setup, api, app, n8n, n8n_nginx, n8n_setup)
## ------------------------------------------------------------------------------

build-web: ## Builds all backend+web containers
Expand All @@ -155,12 +112,6 @@ run-web: ## Runs all backend+web containers
## Restart n8n as a workaround to resolve this known issue: https://github.com/n8n-io/n8n/issues/2155
@docker-compose restart n8n

run-web-debug: ## Runs all backend+web containers in debug mode, where all container output is printed to the console
@echo "==============================================="
@echo "Make: run-web-debug - running web images in debug mode"
@echo "==============================================="
@docker-compose -f docker-compose.yml up db db_setup api app n8n n8n_nginx n8n_setup

## ------------------------------------------------------------------------------
## Commands to shell into the target container
## ------------------------------------------------------------------------------
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Sub-project under the SEISM Capital project, the source of BC’s species inventory data.

The objectives for the BioHubBC project are:
The objectives for the SIMS project are:

- To provide a single source for aquatic and terrestrial species and habitat data.
- To reduce the barriers for collecting and sharing aquatic and terrestrial species and habitat data throughout the province of British Columbia.
Expand Down Expand Up @@ -36,7 +36,7 @@ If prompted, install Docker using Hyper-V (not WSL 2)

### Grant Docker access to your local folders

This setup for biohub uses volumes to support live reload.
This setup for SIMS uses volumes to support live reload.
To leverage live reload you will need to ensure Docker is running using Hyper-V (not the WSL2 engine).

#### MacOS
Expand Down Expand Up @@ -113,9 +113,9 @@ make env
Result of running `make env` for the first time:
![make env screenshot](readme_screenshots/running_make_env.png "Running `make env`")

## Start all BioHub Applications
## Start all SIMS Applications

Starts all applications (database, api, and web app).
Starts all applications (database, api, app, and n8n).

```
make web
Expand All @@ -134,6 +134,10 @@ app:

- `localhost:7100`

n8n:

- `localhost:5100`

# Helpful Makefile Commands

See `./Makefile` for all available commands.
Expand All @@ -156,7 +160,7 @@ make install

## Delete All Containers

Will stop and delete the biohub docker containers.
Will stop and delete the sims docker containers.
This is useful when you want to clear out all database content, returning it to its initial default state.
After you've run `make clean`, running `make web` will launch new containers, with a fresh instance of the database.

Expand Down
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "biohubbc-api",
"name": "sims-api",
"version": "0.0.0",
"description": "API for BioHubBC App",
"description": "API for SIMS Web App",
"license": "Apache-2.0",
"main": "app",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bcgov/biohubbc/app

A standard React web-app for BioHub management activities.
A standard React web-app for SIMS management activities.

## Documenation

Expand Down Expand Up @@ -123,4 +123,4 @@ The simplest solution for now is to keep typescript at the latest `3.x` version.

```
0:0 error Parsing error: Cannot read property 'map' of undefined
```
```
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "biohubbc-app",
"name": "sims-app",
"version": "0.0.0",
"description": "BioHubBC - Web Application",
"description": "SIMS Web App",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions database/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "biohubbc-db",
"name": "sims-db",
"version": "0.0.0",
"description": "Database migrations/seeding for BioHubBC API",
"description": "Database migrations/seeding for SIMS",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
10 changes: 5 additions & 5 deletions env_config/env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ N8N_PROXY_PORT=5100
WEBHOOK_TUNNEL_URL=http://localhost:5100/

N8N_DB_TYPE=postgresdb
N8N_DB_HOST=localhost
N8N_DB_USER=n8n
N8N_DB_PASS=n8n
N8N_DB_PORT=5433
N8N_DB_DATABASE=n8n
# N8N_DB_HOST=localhost
# N8N_DB_USER=n8n
# N8N_DB_PASS=n8n
# N8N_DB_PORT=5433
# N8N_DB_DATABASE=n8n
N8N_DB_SCHEMA=n8n

N8N_BASIC_AUTH_ACTIVE=true
Expand Down
4 changes: 2 additions & 2 deletions n8n/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "biohubbc-n8n",
"name": "sims-n8n",
"version": "0.0.0",
"description": "N8N setup",
"description": "N8N for SIMS",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down