Chapter 1. Configuring GitHub for RHTAP RHTAP uses GitHub to authenticate users. RHTAP also uses GitHub as the destination for repositories that it generates. To enable this functionality, before installing RHTAP in your cluster, you must first complete the following procedures to configure GitHub for RHTAP: Creating a GitHub personal access token Creating a GitHub application (Optional) Forking the software catalog 1.1. Creating a GitHub personal access token Before completing this procedure, you need to own a GitHub organization that you can use for RHTAP. This can be a new organization that you create, an organization you already own, or an existing organization for which you request ownership from the current admins. After installing RHTAP, this GitHub organization gives RHTAP users a place to create git repositories for their applications. Once you own an organization, you are ready to follow the steps in this procedure to create a personal access token. You need this token to run a command that is covered in the procedure. Prerequisites: Ownership of a GitHub organization Procedure: Go to your Developer Settings page in GitHub. In the left panel, under Personal access tokens , select Tokens (classic) . From the Generate new token drop down menu under the page banner, select Generate new token (classic) . You may need to authenticate to continue. Enter a name, select an expiration date, and under Select scopes , select repo (which should automatically include all scopes from repo: status to security_events ). Select Generate token . GitHub redirects you to a new page, where your token is visible. Create a new file called private.env , and save this token in that file. Note The private.env is critical to the success of your installation. Please ensure you create this file and save it in a secure location. 1.2. Creating a GitHub application for RHTAP Creating a GitHub application for RHTAP allows developers to authenticate to Red Hat Developer Hub, which is the user interface (UI) where they can interact with 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 the GitHub organization that you are using for 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. Also be aware that this procedure directs you to pull and start running the installer container image. This installer allows you to automate much of the remaining installation process. Prerequisites A GitHub personal access token (from the procedure) A container management tool on your workstation, such as Podman or Docker Valid credentials for registry.redhat.io ClusterAdmin access to an OpenShift cluster Procedure In your CLI, authenticate to registry.redhat.io . Pull the installer image. Start the rhtap-cli container image. In the running container, login to your OpenShift cluster as ClusterAdmin. Run the following command to start creating a GitHub application. Replace USDGH_TOKEN with the token you created in the procedure. Replace USDGH_ORG_NAME with the name of the GitHub organization you are using for RHTAP. Replace USDGH_APP_NAME with a name you would like to use for your application. The output of this command includes a URL. Use your web browser on your workstation to navigate to this address. When prompted, click Create your GitHub App . The button redirects you to GitHub. If necessary, authenticate in GitHub to confirm access. Then click Create GitHub App for <your organization's name> . A new message displays in your browser, telling you that the app was successfully created. Click on the hyperlinked text to install the new application in your GitHub organization. The link redirects you to GitHub. Click the green Install button. Select the organization that you are using for RHTAP. When prompted, select All repositories , so RHTAP can create new repositories in your organization. Click the green Install button. Note You may want to keep this GitHub page open, although you can close it without interrupting installation. In the page banner, there is a link that you can use after installation to access RHTAP (beginning with https://backstage-developer-hub-rhtap... ). 1.3. (Optional) Forking the RHTAP catalog repository RHTAP provides users with a set of software templates that enable developers to build applications more quickly. You may want to customize these templates, to tailor them to your users' specific needs. To enable this customization, you must fork the repository that contains the default templates now. In a later stage of the installation process, you can configure RHTAP to find software templates in your customizable fork, rather than in the default repository. Procedure: In your web browser, navigate to the RHTAP software catalog repository . Beneath the banner of the page, select Fork and fork the repository. Uncheck the box that says "Copy the main branch only". Once the fork is ready, copy its address. Label and save it in private.env . In your new fork, beneath the banner, click main to open a dropdown menu. Under Tags , select the release that corresponds to the version of RHTAP that you are using. Note Be sure to update your fork from time to time, so updates from the upstream repository can benefit your instance of RHTAP.

Commands:
podman login registry.redhat.io
podman pull registry.redhat.io/rhtap-cli/rhtap-cli-rhel9:latest
podman run -it --entrypoint=bash --publish 8228:8228 --rm rhtap-cli:latest
bash-5.1USD oc login https://api.<input omitted>.openshiftapps.com:443 --username cluster-admin --password <input omitted>
bash-5.1USD rhtap-cli integration github-app --create --token="USDGH_TOKEN" --org="USDGH_ORG_NAME" USDGH_APP_NAME