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

  1. If you do not have a configured authentication to the repository, create one.
    1. In the dashboard, click Authentications
    2. In the Authentications page, click Create authentication.
    3. Give the authentication a unique name and, optionally, a description.
    4. In the Service drop-down, select Git.
    5. 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.
      Email
      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.
    6. Click Save.
  2. In the dashboard, click Workflows.
  3. Click the overflow (three-dot) menu and click Git Config.
  4. In the dialog, in the Auth Key field, select the authentication that you created in step 1.
  5. 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

  6. 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.
  7. 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
  1. 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.
  2. In the overflow (three-dot) menu, click Git Pull & Reset.
  3. In the dialog, review the warning. If you proceed, the workflows in your instance are overwritten with the copies from the repository branch.
  4. If you are happy to proceed, click Git Pull & Reset.
Push workflows to Git
Note: Only the latest version of a workflow can be pushed to Git.
  1. 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.
  2. In the overflow (three-dot) menu, click Git Push.

    For pushing a single workflow, you can alternatively click the Actions menu, then click Push.

  3. In the dialog, add a meaningful message and click Push.
Edit the Git configuration
  1. In the overflow (three-dot) menu, click Edit Git config.
  2. 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.
  3. Click Save.
Delete the Git configuration
  1. In the overflow (three-dot) menu, click Delete Config.
  2. In the dialog, review the warning.
  3. When you are happy to proceed, click Delete.