This documentation is for a release that is no longer maintained
See documentation for the latest supported version.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 2. Configuring GitHub for RHTAP
After installation, 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 personal access token
- Creating a GitHub application
- (Optional) Forking the software catalog
Below are the detailed instructions for each of these procedures.
2.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 have control over, or an existing organization for which you must request the appropriate permissions from the current admins. After installing RHTAP, this GitHub organization gives RHTAP users a place to automatically 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 next procedure.
Prerequisites:
- A GitHub account
- 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. Make sure to label and save this token somewhere in your files.
NoteIf you plan to complete any of the optional procedures, we recommend creating a file (for example,
~/install_values.txt) where you can store all the values that those procedures generate, along with this access token.
2.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 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 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. You must also be log into an OpenShift cluster, where the app credentials are stored as a Kubernetes secret.
Prerequisites
- Ownership of a GitHub organization
- A GitHub personal access token (from the previous procedure)
- ClusterAdmin access to an OpenShift cluster
Procedure
- In the web UI or your CLI, login to the OpenShift cluster where you plan to install RHTAP.
In your CLI, run the following command to start creating a GitHub application. Replace $TOKEN with the token you created in the previous procedure. Replace $ORG_NAME with the name of the GitHub organization you are using for RHTAP. Replace $APP_NAME with a name you would like to use for your application.
Replace $CONFIG with the path of the
config.yamlfile that lists the Helm charts needed to install the required RHTAP components. By default, this file is located in therhtap-cli/installerdirectory.NoteYou don’t need to add the
--configparameter if you run therhtap-cli integrationcommand from a local clone of the rhtap-cli repo and you’re in the corresponding branch. In this case, RHTAP locatesconfig.yamlautomatically.rhtap-cli integration github-app --create --token="$TOKEN" --org="$ORG_NAME" $APP_NAME --config="$CONFIG"
$ rhtap-cli integration github-app --create --token="$TOKEN" --org="$ORG_NAME" $APP_NAME --config="$CONFIG"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - A web browser window should open. In that window, 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, 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.
NoteYou may want to keep this GitHub page open, even though 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…).
2.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
mainbranch only".
-
Uncheck the box that says "Copy the
-
Once the fork is ready, copy its address. Label and save it in
~/install_values.txt. 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.
NoteBe sure to update your fork from time to time, so updates from the upstream repository can benefit your instance of RHTAP.