- Quick install with homebrew
- Services creation
- Db helpers creation
- Database seeding
- How to run in dev mode
- If you want to run without cli
- What is my purpose and why go
- Autogenerated docs about cli
brew tap andriiklymiuk/homebrew-tools brew install corgi # ask for help to check if it works corgi -h
It will install it globally.
With it you can run
corgi in any folder on your local.
Create service file, if you want to run corgi.
If you want to run db_services or your services require docker, then you need
If you want to use auto seeding feature for postgres databases, you need to install
You need to create corgi-compose.yml file in root of your target repo to create services and db services. It should be created in the following way:
db_services: corgi: databaseName: corgi-database user: corgi password: corgiSecurePassword port: 5432 #Use seedFromFilePath or seedFromDb/seedFromDbEnvPath, only one will work seedFromFilePath: path/to/dump.sql to use, it will precede before seedFromDb. # can be empty, use either seedFromDbEnvPath or seedFromDb seedFromDbEnvPath: path/to/db/info/.env seedFromDb: host: db_host_for_seed_seed_db databaseName: db_name_for_seed_db user: db_user_for_seed_db password: db_password_for_seed_db port: db_port_for_seed_db corgiTest: databaseName: corgi-database-test user: corgi password: corgiSecurePasswordTest port: 5433 services: corgiServer: # copyEnvFromFilePath: path_to_copy_env_from environment: - PORT=8965 depends_on_db: - corgi beforeStart: - install your dependencies or do other stuff - that needs to be run before start cmd start: - start corgiServer corgiApp: cloneFrom: url_to_use_in_git_clone_if_path_doesn't_exist path: /path/for/service environment: - SOME_ENV=corgi_is_best - SOME_ENV2=corgi_is_best_indeed depends_on_services: - name: corgiServer envAlias: BEST_CORGI_SERVER_URL beforeStart: - install your dependencies or do other stuff - that needs to be run before start cmd start: - start corgiApp afterStart: - do some cleanup staff on service close
Then run, which will create db_services.
Or, if you want to just run services and already created db_services:
Tip: there can be as many services as you wish. But create it with different ports to be able to run in all at the same time, if you want.
The beauty of this cli is that it is versatile and can be run without even opening cli, if it is broke or smth has happened to it. All database services are in
corgi_services/db_services folder, so you can go to interested service folder and just run
make up to start the database.
It can be done so, because cli is dependent upon on
docker-compose.yml and MAKEFILE for each service, and it can be run independently.