CircleCI is a tool used for continuous integration. It allows projects to build, test, and deploy projects across multiple platforms. Comparative tools include GitHub ACtions, Jenkins, Buddy, etc. CircleCI is part of the devops chain in development.
Configuration
.circleci directory, typically at the root of the project, contains a config.yml file consisting of YAML.
YAML anchors provide a way to add reusable variables. E.g., production-remote-user: &production-remote-user "someuserhere" will allow
Consists of “jobs” and “workflows” – workflows orchestrate jobs.
Most projects are located under kanopi – however, some projects run under another, separate organization. Use the dropdown in the upper top left to access different organizations.
The projects link shows all available CircleCI projects. Helpfully, the most recently run projects will float to the top of the list.
Scripts
CircleCI can run custom scripts – for example, running a Pantheon-specific deployment workflow with various Terminus commands. Scripts are typically included under .circleci/scripts/.
Environment Variables
When an environment variable is needed, CircleCI provides
. This CLI offers a number of useful tools – chiefly, the ability to test and validate your local configuration before deploying. Running circleci config validate is an easy (and very fast) way to test out your current configuration. Check this
When making updates – you can typically set dry-run: true within the job steps to run the job without making actual changes. This is especially helpful when making any change that could impact an environment currently in use (especially production).
You may need to update the job’s branch to include your feature branch, as this will allow you to test your configuration changes without merging them into main.
Common Problems
General Failure Troubleshooting Steps:
Rerun the job via CircleCI buttons to ensure it was not a momentary glitch.
Check the status of CircleCI, Pantheon, WP Engine, etc. Basically, make sure the failure is not a temporary hiccup. Retry again later once the status issues have resolved.
Missing Files on Rsync Based Deployment: Check the exclude_files.txt list (typically located either in the root directory or .circleci directory) and make sure the file, or a pattern relating to that file, is not excluded from deployment.
“Cannot access install” on WP Engine: Make sure that code@kanopistudios.com has been added to the WP Engine account users. In most cases, this must be done by the client as we do not have full owner access to many WP Engine accounts. Additionally, make sure that the deployment-context contains kanopi-code-wpengine.
Permission Denied: the script permissions in .circleci directory likely need to be reset. It can be reset as part of the local Docksal spin-up.