How to work with Git via Roxy-WI
Configuration files are very precious and dynamic. It is a good practice to store them in a version control system in order to track changes. The benefits of this practice are the following:
- The structure of your configuration file is maintained in the repository
- You can maintain reasonable defaults for config options that are the same between dev, testing and production
- You can store configs for different use cases in one place
- You can easily track changes in your config files and rollback to the previous versions if necessary
Roxy-WI enables you to work with git repositories via the intuitive graphical interface. It is very useful for users who do not have much experience with the command line and need visual representation. Advanced user will also appreciate this feature as it allows to save time and automate working with git.
To start working with git, select Servers in the Admin Area. Go to the Git tab. To enable pushing configs to repository, click on the Add git job button. You should see the following form appear:
The form contains the following fields:
- Server - the server where the config to be pushed is located;
- Service - the service whose config should be pushed to git;
- Period - the frequency of pushing: you can push daily, weekly, monthly;
- Init a new repository - this checkox is set if you have not initialised the repository in the folder where the config files are stored
- Repository - the address of the repository;
- Branch - the branch in the repository to which the config should be pushed;
- Credentials for a git user - user credentials for the authentication in the repository;
- Description - any other additional information
Remember to add your public key to git in order to be able to authenticate via SSH.
If the config files are stored in a new folder where the repository has not been initialized yet, set the checkbox Init a new repository. When you click the Add git job button, the command necessary to initialize the repository (git init and git add remote) will be performed automatically.
If you push the configs to an existing repository, specify the name of the branch in the appropriate field.