Skip to main content

Corgi compose items

Links meme

Examples of these items usage can be found in examples repo.

You can add service in services part of yml file.

Corgi compose service can contain the following items (properties):

ItemExampleitemTypeDescription
cloneFromgit@github.com:Andriiklymiuk/corgi.gitstringGit url to target repo. By default nothing is cloned.
branchsome/feature/branchstringBranch to use for git checkout. By default default branch for repo is used.
environment- YOUR_ENV=dev- YOUR__ANTOHER_ENV=abcdef[]stringList of environment variables to copy and put into your env file.By default no environments are added.
envPath./path/to/.envstringPath to .env file in target repo. By default .env file is used
ignoreEnvfalsestringShould service ignore env and don't change env file or not. By default is false (env is not ignored)
path./path/to/target/repostringPath to the actual project repo.By default the path to the folder in which corgi-compose.yml is used
copyEnvFromFilePath./path/to/.env-file-to-copy-fromstringThe path to the .env, which content will be copied to service repo .env file
port5432numberService port, that will be added to .env file.
portAliasPORTstringService port env name alias, that will be added to .env file.
manualRuntruebooleanDetermines if the service will be run with run cmd.If it is true, that to run you add --services manual_to_run_service to run cmd.By default it is false.
depends_on_db- name: db_name_from_db_services- envAlias: NAME_BEFORE_DB_IN_ENV[]DependsOnDbAdds db credentials (DB_HOST,etc) from db_services will be copied to .env.envAlias adds string before db credentials, like NAME_BEFORE_DB_IN_ENV_DB_HOST
depends_on_services- name: service_name- envAlias: NAME_TO_USE_IN_ENV- suffix: /special/suffix[]DependsOnServiceAdds service credentials to .env.suffix is added at the end of added valueNAME_TO_USE_IN_ENV=localhost:port/special/suffix will be added to .envIf you add just name, than it is SERVICE_NAME=localhost:port_in_env
beforeStart- install dependencies- do some builds[]stringList of commands to run consequently, before start commands are run.
start- run your service- run some other stuff[]stringList of commands to run in parallel for the service needs.
afterStart- do some needed cleanups[]stringList of commands to run consequently, when the cli is exited.

Also, you can add service in db_services part. Corgi compose db_service can contain the following items (properties):

ItemExampleitemTypeDescription
driverpostgresstringThis is database driver for this service. By default postgres is used.
hostlocalhoststringThis is database host for this service, that will be used in DB_HOST. By default localhost is used
version1.0.1stringThis is database version for the service creation. By default latest is used
databaseNamecorgi-databasestringThis is database name for this service, that will be used in DB_NAME
usercorgistringThis is database user for this service, that will be used in DB_USER
passwordcorgiSecurePasswordstringThis is database password for this service, that will be used in DB_PASSWORD
port5432numberThis is database port for this service, that will be used in DB_PORT
seedFromFilePath./path/to/dump.sqlstringPath to dump.sql file from which data is seeded.Use either seedFromFilePath or seedFromDb/seedFromDbEnvPath
seedFromDbEnvPath./path/to/db/info/.envstringPath to .env file with db credentials for db, from which data is seeded.Use either seedFromFilePath or seedFromDb/seedFromDbEnvPath
seedFromDb- host: seed_db_host- databaseName: seed_db_name- user: seed_db_user- password: seed_db_password- port: seed_db_portSeedFromDbDb credentials to seed from.Use either seedFromFilePath or seedFromDb/seedFromDbEnvPath

Also, you can add required items in required part. Corgi compose required can contain the following items (properties):

ItemExampleitemTypeDescription
why- pass butter- help with service X[]stringThe reasons to use/install this required command.
install- install cmd 1- install cmd 2[]stringInstallation steps to run, if cmd not found.
optionaltruebooleanShow or not the prompt, before this cmd installation.By default false.
checkCmdthis_command -vstringCommand to run to check, if it is installed.By default cmd name is used.

Main docs