Manage roles and capabilities without loads of code

I want to manage user roles and permissions/capabilities. I’ve tried several plugins, but they save their settings to the database. Since we’re running multiple environments with seperate databases, saving to the database is inconvenient. After every deploy we’d have to update the settings on the other environment.

I’d like to persist my roles and capabilities to file so I can check them in to VCS and update capabilities with every deploy automatically. Preferably without having to write loads of code.