Create an Application Accelerator Git repository during project creation

This topic describes how to enable and use the GitHub repository creation in the Application Accelerator plug-in.

Overview

The Application Accelerator plug-in uses the Backstage GitHub provider integration and the authentication mechanism to retrieve an access token. Then it can interact with the provider API to create GitHub repositories.

Supported Providers

The supported Git providers are GitHub and GitLab.

Configure

The following steps describe an example configuration that uses GitHub:

  1. Create an OAuth App in GitHub based on the configuration described in this Backstage documentation. GitHub Apps are not supported. For more information about creating an OAuth App in GitHub, see the GitHub documentation.

    These values appear in your app-config.yaml or app-config.local.yaml for local development. For example:

    auth:
     environment: development
     providers:
       github:
         development:
           clientId: GITHUB-CLIENT-ID
           clientSecret: GITHUB-CLIENT-SECRET
    
  2. Add a GitHub integration in your app-config.yaml configuration. For example:

    app_config:
      integrations:
         github:
            - host: github.com
    

    For more information, see the Backstage documentation.

(Optional) Deactivate Git repository creation in the Application Accelerator extension for VS Code

From Tanzu Application Platform v1.4, the Application Accelerator extension for VS Code uses the Tanzu Application Platform GUI URL to interact with the accelerator system. There is a new plug-in called gitProviders that you can configure to deactivate Git repository creation in the VS Code extension.

To deactivate Git repository creation, set app_config.gitProviders.active to false in tap-values.yaml as shown in the following example:

   app_config:
      gitProviders:
         active: false

Use Kubernetes secrets

To use Kubernetes secrets to set the values for clientId and clientSecret:

  1. Create the Kubernetes secret with the values that you want by running:

    kubectl create secret githubOauthApp \
    --from-literal=clientSecret=GITHUB-CLIENT-SECRET \
    --from-literal=clientId=GITHUB-CLIENT-ID
    
  2. Edit the app-config.yaml by using the environment variables. For example:

    app_config:
      auth:
         environment: development
         providers:
            github:
               development:
               clientId: ${clientId}
               clientSecret: ${clientSecret}
    

Create a Project

To create a project:

  1. Go to Tanzu Application Platform GUI, access the Accelerators section, and then select an accelerator. The accelerator form now has a second step named Git repository.

  2. Fill in the accelerator options and click Next.

  3. Select the Create Git repo? check box.

  4. Fill in the Owner, Repository, and Default Branch text boxes.

    Screenshot of the Git repository creation text boxes.

  5. After entering the repository name, a dialog box appears that requests GitHub credentials. Log in and then click Next.

    Dialog box that prompts you to log in to GitHub.

    Screenshot of GitHub log-in credential text boxes.

  6. Click GENERATE ACCELERATOR. A link to the repository location appears.

    Screenshot of the output status, which includes a Download ZIP File button.

check-circle-line exclamation-circle-line close-line
Scroll to top icon