Using Git with workflows
In your IBM® Rapid Infrastructure Automation® instance, you can connect to a remote Git repository, then push your workflows to the repository or pull them from the repository into your instance.
Before you begin
You must have a GitHub account and an established repository. Decide which workflows you want to push into your repository and which to pull from it.
Connecting to a Git repository and branch
- If you do not have a configured authentication to the repository, create one.
- In the dashboard, click Authentications
- In the Authentications page, click Create authentication.
- Give the authentication a unique name and, optionally, a description.
- In the Service drop-down, select Git.
- Provide the Git service credentials.
- URL
- The unique link of your Git repository.
- You can enter the path now or click Overridable if you prefer to enter it when you set up the Git configuration.
- If you enter a value now and you do not click Overridable, then the value cannot be changed after you save the authentication.
- To enter it now, specify the full path ending in
<your-project>.git, for example:https://github.com/my_user/flek3s.git
- Branch
- The repository branch that you want to use.
- You can manually enter the branch name now or click Overridable if you prefer to select it when you set up the Git configuration.
- If you enter a branch name now and you do not click Overridable, then the branch cannot be changed after you save the authentication.
- If you enter a branch name now, make sure you enter the name of a branch that exists in the repository.
- Username
- The username associated with your Git provider.
- Password
- The password associated with your Git username. If you are using GitHub Cloud or Enterprise, the password must be a personal access token for the user.
- The email address associated with your Git username.
- RSA private key
- The private key that is used for SSH key authentication, if you are using SSH instead of password or token authentication.
- Click Save.
- In the dashboard, click Workflows.
- Click the overflow (three-dot) menu and click Git Config.
- In the dialog, in the Auth Key field, select the authentication that you created in step 1.
- Optional: If you made the URL overridable when you created the authentication key, specify the URL.
In the URL field, enter the full path ending in
<your-project>.git, for example:https://github.com/my_user/flek3s.git - Optional: If you made the branch overridable when you created the authentication key, select the repository branch that you want to use for pushing and pulling your workflows.
- Click Save.
Git actions and options
Now that your Git connection is configured, you can use the new overflow (three-dot) menu options in the Workflows page to perform the following tasks:
- Pull workflows from Git
-
- If you want to pull only specific workflows from the repository, select them in the workflow list.
Important: By default, all matching workflows in your instance are overwritten when you pull from the repository. To overwrite only specific workflows, you must select them in the workflow list.
- In the overflow (three-dot) menu, click Git Pull & Reset.
- In the dialog, review the warning. If you proceed, the workflows in your instance are overwritten with the copies from the repository branch.
- If you are happy to proceed, click Git Pull & Reset.
- If you want to pull only specific workflows from the repository, select them in the workflow list.
- Push workflows to Git
-
Note: Only the latest version of a workflow can be pushed to Git.
- If you want to push only specific workflows to the repository, select them in the workflow list.
Important: By default, all matching workflows in your repository are overwritten when you push from your instance. To push only specific workflows, you must select them in the workflow list.
- In the overflow (three-dot) menu, click Git Push.
For pushing a single workflow, you can alternatively click the Actions menu, then click Push.
- In the dialog, add a meaningful message and click Push.
- If you want to push only specific workflows to the repository, select them in the workflow list.
- Edit the Git configuration
-
- In the overflow (three-dot) menu, click Edit Git config.
- In the dialog, update the repository URL or repository branch. You can update these fields if you specified them as overridable when you created the authentication key.
- Click Save.
- Delete the Git configuration
-
- In the overflow (three-dot) menu, click Delete Config.
- In the dialog, review the warning.
- When you are happy to proceed, click Delete.