This is the home of the global configuration for CapSens project's CircleCI pipelines.
It runs RSpec, handles the assets (Webpacker and Sprockets), and much more.
- Enable dynamic config for your project in CircleCI (Project Settings > Advanced > Enable dynamic config using setup workflows).
- Copy the file
config.yml.example
to your project's.circleci/config.yml
. - Choose the appropriate template file (e.g.:
configs/rails_config.yml
). - If applicable, copy the file
database.yml.ci.example
(ordatabase_mysql.yml.ci.example
if you are using the MySQL template fileconfigs/rails_config_mysql.yml
) to your project'sconfig/database.yml.ci
. - Adapt your
.circleci/config.yml
file with the appropriate parameters (the full list of available parameters can be found inside the template file).- The
project-name
config file parameter must match theusername
anddatabase
variables of the CI database file.
- The
- Don't forget to activate your project (if necessary) on CircleCI (https://app.circleci.com/projects/project-dashboard/github/CapSens/ => "Set up Project")
When using the dynamic config in a Rails application that has per-environment encrypted credentials, the configs/rails_config_with_per_env_credentials.yml
file must be used.
This config file requires two environment variables:
RAILS_MASTER_KEY_STAGING
: This is theRAILS_MASTER_KEY
for the encrypted credentials of the staging environmentRAILS_MASTER_KEY_PRODUCTION
: This is theRAILS_MASTER_KEY
for the encrypted credentials of the production environment
To use this config, copy the file config_with_per_env_credentials.yml.example
to your project's .circleci/config.yml
.
You can enable the tests parallelism by providing the tests-parallelism
variable with a value greater than 1.
It will split the RSpec suite in X smaller pipelines that should really speed up the execution time if your project's tests are slow.
Be careful, as it will spawn real containers. So, for example, if you set tests-parallelism
to 3, each pipeline (commit) running on your project will effectively run 4 pipelines. That leaves that much less spots in the queue for your other projects and other pipelines to run. So, consider this option ONLY if this is worth it.