Page
Set up a GitHub organization for Red Hat Developer Hub
To configure the GitHub settings for an organization within Developer Hub, it is essential to establish secrets, ConfigMaps, and other necessary configurations within the sandbox environment. The following steps will instruct you on how to achieve this result.
What you need
- GitHub setup for Developer Hub
- A Developer Sandbox account
What you will do
- Create a custom ConfigMap for your GitHub organization in the Developer Sandbox.
Create a custom ConfigMap for GitHub organization
- Log into the Developer Sandbox.
From the left menu, check the
app-config-rhdh
ConfigMap and add the following GitHub App configurations to it, as shown in Figure 1:kind: ConfigMap apiVersion: v1 metadata: name: app-config-rhdh data: app-config-rhdh.yaml: | app: title: Red Hat Developer Hub integrations: github: - host: github.com token: ${GITHUB_TOKEN} apps: - appId: ${GITHUB_APP_APP_ID} clientId: ${GITHUB_APP_CLIENT_ID} clientSecret: ${GITHUB_APP_CLIENT_SECRET} webhookUrl: ${GITHUB_APP_WEBHOOK_URL} webhookSecret: ${GITHUB_APP_WEBHOOK_SECRET} privateKey: | ${GITHUB_APP_PRIVATE_KEY} auth: environment: development providers: github: development: clientId: ${GITHUB_APP_CLIENT_ID} clientSecret: ${GITHUB_APP_CLIENT_SECRET} enabled: github: true
- Click Save.
- Creating GitHub App Configurations in Your Organization:
- Log in to your GitHub Organization.
From the top navigation, select Settings.
- On the left menu, click Developer Settings.
- Select GitHub Apps.
- Click on New GitHub App.
- Fill in the required details according to your needs.
- Ensure that you added your cluster's Callback URL in the format: https://developer-hub-<namespace>.<openshift-host>/api/auth/github/handler/frame
- For example: https://developer-hub-rh-ee-narathod-dev.apps.sandbox-m2.ll9k.p1.openshiftapps.com/api/auth/github/handler/frame
- Click on the Create GitHub App.
Creating a GitHub Token:
- Ensure you create a Fine-grained Personal Access Token with the appropriate read and write permissions.
- Select Secrets from the left side menu.
- Create a new secret and name it rhdh-secrets. As shown in figure below.
- Add the environment variables into secrets (defined in the ConfigMap) in key and value form.
- Click Create.
- Revisit the Developer Sandbox and select Helm.
- Next to the developer-hub Helm chart, select the vertical dots on the right of the line.
Choose Upgrade, as shown in Figure 2.
- Under Root Schema -> Backstage Chart Schema -> Backstage Parameters -> Backstage container environment variables from existing Secrets, add
rhdh-secrets
as the value. - Click Upgrade.