Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 1. Creating a GitHub application for RHTAP

download PDF

Creating a GitHub application for RHTAP allows developers to authenticate to Red Hat Developer Hub, which is the user interface (UI) where they can use RHTAP. This GitHub application also allows RHTAP to access developer’s source code that is hosted on GitHub.

Keep in mind that you must create and install the new application in a GitHub organization that you own and want to use for your instance of Red Hat Trusted Application Pipeline. RHTAP can subsequently create new repositories within that organization, to serve as the source code for the applications it builds.

Prerequisites

  • Ownership of a GitHub organization

Procedure

  1. Login to GitHub and go to your organizations (Settings > Organizations).
  2. Click on an organization that you own and want to use for this instance of RHTAP. Or you can select New organization to create a new organization.
  3. In the organization context, navigate to the GitHub Apps page (Settings > Developer settings > GitHub Apps).
  4. Near the top banner, on the right side of the page, select New GitHub App.
  5. If prompted, authenticate as needed.
  6. In the GitHub App name field, enter a unique name.
  7. In the Homepage URL field, enter a placeholder value, for example, https://www.placeholder.com.
  8. In the Callback URL field, enter a placeholder value. You can use the same placeholder value, for example, https://www.placeholder.com.
  9. In the Webhook URL field, enter a placeholder value. You can use the same placeholder value, for example, https://www.placeholder.com. Also, ensure that the Active checkbox is checked (GitHub should do this by default).
  10. Create a new file on your local system, in which you save several values that you need for later steps in the installation process. When you enter values in this file, make sure to label them, so you can remember what each value is later on.

    $ touch ~/install_values.txt
  11. In your CLI, generate a secret, then label and save it in ~/install_values.txt.

    1. If you do not have OpenSSL, you can follow the download instructions.

      $ openssl rand -hex 20 >> ~/install_values.txt
      Important

      Be sure to save the output of this command!

  12. In GitHub, in the Webook secret field, enter the output of the last command.
  13. Under Repository permissions, set the following permissions:

    1. Administration: Read and write
    2. Checks: Read and write
    3. Contents: Read and write
    4. Issues: Read and write
    5. Metadata: Read-only (this should already be set correctly, but verify its value)
    6. Pull requests: Read and write
  14. Under Organization permissions, set the following permissions:

    1. Members: Read-only
    2. Plan: Read-only
  15. Under Subscribe to events, select the following subscriptions:

    1. Check run
    2. Check suite
    3. Commit comment
    4. Issue comment
    5. Pull request
    6. Push
  16. Under Where can this GitHub App be installed? select Any account.
  17. Click Create GitHub App. You should then see the Developer Settings page.
  18. Retrieve the Client ID and Application ID. Label and save them in your ~install_values.txt.

    Important

    The next two steps explain how to gather a client secret and a private key. You must save the client secret and private key, and keep them accessible, to complete the installation process for RHTAP!

  19. On your new application’s page, next to Client secrets, select Generate a new client secret. Label and save the client secret, in ~/install_values.txt.
  20. On the same page in GitHub, under Private keys, select the Generate a private key button. Your system downloads a private-key file, which contains the private key. Label and save the content of the private key file in ~/install_values.txt. The private key should start with -----BEGIN RSA PRIVATE KEY-----, and end with -----END RSA PRIVATE KEY-----.
  21. Still on the same page in GitHub, from the tabs on the left-hand side, select Install App.
  22. Use the green Install button next to the name of your organization.
  23. When prompted, select All repositories, so RHTAP can create new repositories in your organization. Click the green Install button.

Additional resources

Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.