A command line tool to setup deployment variants and working CI/CD setup for mobile projects.
Variants aims to facilitate the setup and usage of multiple deployment variants for a mobile application (iOS and Android) while also providing a fully working and rich Fastlane setup, with opt-in features for your pipelines. While achieving these goals, it also reduces the amount of sources of truth in your configuration, by relying only on the Variants Spec - a YAML configuration file generated by variants init.
Variants spec - by default located at ./variants.yml, relative to your project's base folder - becomes the sole source of truth and the main configuration file for your needs.
This file is responsible for:
- Specifying how many deployment variants you desire for this project and the differences between these variants (Name, Icon, Identifier, Version, and more with Custom Properties);
- Which store do you want Fastlane to deploy each variant to;
- Signing configuration. Both global (applies to all) and variant specific (overrides global);
- Custom properties. Both global (applies to all) and variant specific (overrides global). Custom properties have different destinations, so that certain properties aren't available to Fastlane but to Project and vice-versa. These can also be sourced from environment variables, perfect for secrets and tokens.
- ✅ Setup your mobile project to have multiple variants of the same application.
- ➡️ Each variant having it's own:
- Name
- Identifier
- Icon
- Version
- Specific tasks and configurations
- Anything really!
- ➡️ Each variant having it's own:
- ✅ Setup CI/CD using fastlane.
- ➡️ Lanes for specific tasks:
- Setup CI
- Create Keychain
- Perform Unit and UI tests
- Lint and format
- Complexity analisys
- Sonar report
- Build and sign application
- Deploy to AppCenter / PlayStore / AppStore
- Many more!
- ➡️ Lanes for specific tasks:
In order to generate the code from templates, Variants requires Python 3. We recommend configuring the python version using a version management tool such as Pyenv.
For details on how to install and use it check the Pyenv repo.
See Switching Variants on CI for a better understanding and examples.
brew install backbase/m/variantsFor Linux, make sure you have Swift installed by running
swift --version
git clone https://github.com/backbase/variants.git
cd variants
make installOnce the installation is completed, the binary will be added to your ~/.local folder. Make sure to have the folder included in your PATH variable. This should be done in the shell configuration file
Add the following to the ~/.zshrc or ~/.bashrc file:
export PATH=$HOME/.local/bin:/usr/local/bin:$PATHMake sure to restart your terminal or source the changed file with source ~/.zshrc or source ~/.bashrc
git clone https://github.com/backbase/variants.git
cd variants
swift run variantsFor usage and examples see USAGE.
Specifying your project's platform (ios or android) isn't always necessary. Variants is able to detect which platform your project is.
See our Platform Auto Detection for a better understanding and examples.