This topic describes how to enable and use the GitHub repository creation in the Application Accelerator plug-in.
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.
The supported Git providers are GitHub and GitLab.
The following steps describe an example configuration that uses GitHub:
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
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.
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
To use Kubernetes secrets to set the values for clientId
and clientSecret
:
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
Edit the app-config.yaml
by using the environment variables. For example:
app_config:
auth:
environment: development
providers:
github:
development:
clientId: ${clientId}
clientSecret: ${clientSecret}
To create a project:
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.
Fill in the accelerator options and click Next.
Select the Create Git repo? check box.
Fill in the Owner, Repository, and Default Branch text boxes.
After entering the repository name, a dialog box appears that requests GitHub credentials. Log in and then click Next.
Click GENERATE ACCELERATOR. A link to the repository location appears.