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 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

      

    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. Creating GitHub App Configurations in Your Organization:
    • Log in to your GitHub Organization.
    • From the top navigation, select Settings

      select the setting option from the GitHub organization.
      Figure: Select the setting option from the GitHub organization.
      • 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.
  5. 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 credentials in secretes
    Figure : Add credentials in secretes.
  6. Add the environment variables into secrets (defined in the ConfigMap) in key and value form.
  7. Click Create.
  8. Revisit the Developer Sandbox and select Helm.
  9. Next to the developer-hub Helm chart, select the vertical dots on the right of the line.
  10. Choose Upgrade, as shown in Figure 2.

    Installed Helm chart upgrade viewpoint in Developer Sandbox.
    Figure 2: Upgrade the Helm chart to add configurations.
  11. Under Root Schema -> Backstage Chart Schema -> Backstage Parameters -> Backstage container environment variables from existing Secrets, add rhdh-secrets as the value.
  12. Click Upgrade.
Previous resource
Overview: Application development with Red Hat Developer Hub
Next resource
Use your GitHub organization to onboard the developer