Application development with Red Hat Developer Hub

Learn how to onboard developers onto Red Hat Developer Hub, so they can import and use relevant templates and run the application on the development environment.

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

  1. Log into the Developer Sandbox.
  2. From the left menu, check the app-config-rhdh ConfigMap and add the following GitHub 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
             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
     
    The OpenShift Developer YAML viewpoint ConfigMaps screen showing Developer Hub's ConfigMaps.
    Figure 1: ConfigMap update for GiHub organization in Developer Sandbox.
  3. Click Save.
  4. Select Secrets from the left side menu.
  5. Create a new secret and name it rhdh-secrets.
  6. Add the environment variables into secrets (defined in the ConfigMap) in key and value form.
  7. Click Create.

  8. Log into your GitHub organization on Github.com and 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
  9. Revisit the Developer Sandbox and select Helm.

  10. Next to the developer-hub Helm chart, select the vertical dots on the right of the line.

  11. Choose Upgrade, as shown in Figure 2.

    Installed Helm chart upgrade viewpoint in Developer Sandbox.
    Figure 2: Upgrade the Helm chart to add configurations.
  12. Under Root Schema -> Backstage Chart Schema -> Backstage Parameters -> Backstage container environment variable from Secrets, add rhdh-secrets as the value.

  13. Click Upgrade.

Previous resource
Overview: Application development with Red Hat Developer Hub
Next resource
Use your GitHub organization to onboard the developer