Installing GitHub Insights
You can install GitHub Insights and connect the standalone application to GitHub Enterprise.
GitHub Insights 可用于 GitHub One。 更多信息请参阅“GitHub 的产品”。
本文内容
基本要求
- You must have a GitHub Enterprise license file that has been updated to include GitHub Insights. GitHub will provide the license file when you purchase GitHub Insights.
- GitHub Insights requires a minimum of two machines hosted either in the cloud or locally. For more information, see "System overview for GitHub Insights."
创建 GitHub 应用程序
To connect GitHub Insights to GitHub Enterprise, you must create a GitHub 应用程序 in an organization on GitHub Enterprise. A slugged version of your app's name will be shown on GitHub Enterprise when your integration takes an action.
-
登录到
http(s)://HOSTNAME/login
上的 您的 GitHub Enterprise Server 实例。 -
Navigate to the organization you'd like to connect to GitHub Insights.
-
在组织名称下,单击 Settings(设置)。
-
在左侧边栏中,单击 GitHub 应用程序。
-
Click New GitHub 应用程序.
-
Under "GitHub 应用程序 name", type a name for the app. Your app cannot have the same name as an existing user or organization, unless the name is your own user or organization name.
-
Under "Homepage URL", type the URL of the machine you will use as the application server for GitHub Insights. For more information, see "System overview for GitHub Insights."
-
Under "User authorization callback URL", type the following, replacing
<application-server-url>
with the URL of the machine you will use as the application server for GitHub Insights and<company-name>
with the name of your company.<application-server-url>/public/applogin/<company-name>
-
Under "Webhook URL", type
<application-server-url>/webhooks/<company-name>
. -
Under "Webhook secret", type a secret, then record the secret for later reference.
-
Under "Permissions", use the drop-down menus and configure the following permissions for the app.
- Repository contents: Read-only
- Repository metadata: Read-only
- Pull requests: Read-only
- Commit statuses: Read-only
- Organization members: Read-only
- Organization projects: Read-only
-
Under "Subscribe to events", select:
- 拉取请求
- 推送
- Repository
-
To enable the GitHub 应用程序 to access data from any user or organization in 您的 GitHub Enterprise Server 实例, under "Where can this GitHub 应用程序 be installed?", select Any account.
-
Click Create GitHub 应用程序.
-
Review your app's configuration.
-
Under "Private keys", click Generate a private key.
-
Save the resulting PEM file for later reference.
-
Make note of the following information about your app for later reference.
- App ID
- Client ID
- Client secret
- Private key
- Webhook secret
安装 GitHub Insights
Installing GitHub Insights requires Docker. 安装脚本将安装 Docker(如果能安装)。 如果脚本无法安装 Docker,脚本将尝试使用 Docker 的现有安装。 如果主机上没有安装 Docker,安装将失败。
-
在
github/insights-releases
的发行版页面上,找到 GitHub Insights 的最新版本。 -
要下载最新版本,请在“Assets(资产)”下单击
installation.tgz
。 -
解压缩目录。
-
To configure the installation, run the shell script
configure.sh
. The script can be run from any machine that can SSH into the application and import servers and does not need to be run from either host machine. -
Enter the same URL you used for the application server when creating the GitHub 应用程序.
-
Enter the SSH user for connecting to the application server.
-
Enter the URL for the machine you will use as the import server for GitHub Insights. For more information, see "System overview for GitHub Insights."
-
Enter the SSH user for connecting to the import server.
-
Enter the path to the PEM key for SSH authentication with the application server.
-
If you want to use a different PEM key for SSH authentication to the import server, enter the path to the PEM key. Otherwise, leave blank.
-
If using a bastion host, enter the path to the public key (
.pub
). Otherwise, leave blank. -
To enable SSL, enter the SSL Cert (
.crt
). If you don't want to enable SSL, leave blank. -
If you chose to enable SSL, enter the SSL Key (
.key
). Otherwise, leave blank. -
If using a bastion host, enter the user and URL in the form of
user@my.bastion.address
. Otherwise, leave blank. -
If users will access GitHub Insights through a gateway or proxy, enter the base URL including the protocol in the form of
protocol://host
. -
The installation configuration is now saved. You will see a message printed to the terminal.
Saving configured settings to /Users/octocat/Projects/insights/install/0.2.9/install_data/.env
-
要开始安装,请运行 shell 脚本
release-assets/insights.sh
。 -
安装的运行需要几分钟。 完成后,您将看到终端上显示一条消息。
PLAY RECAP ******************************************** application: ok=20 changed=7 unreachable=0 failed=0 import : ok=29 changed=9 unreachable=0 failed=0
配置 GitHub Insights
To configure GitHub Insights to connect to GitHub Enterprise Server, you must provide the information you recorded in previous steps.
-
In your browser, navigate to
<application-server-url>/setup
. -
Under "Company Name", type the same company name you used when creating the GitHub 应用程序.
-
在“GitHub API URL”下,输入 用来访问 GitHub Enterprise 的 URL。
-
在 "GitHub Insights 许可"下,单击"Choose Files(选择文件)",然后上传您的 GitHub Enterprise 许可文件。
-
在“App ID(应用程序 ID)”下,输入您在创建应用程序时记录的 GitHub 应用程序 应用程序 ID。
-
在“Client ID(客户端 ID)”下,输入您在创建应用程序时记录的 GitHub 应用程序 客户端 ID。
-
在“Client Secret(客户端密码)”下,输入您在创建应用程序时记录的 GitHub 应用程序 客户端密码。
-
在“Private Key(私钥)”下,输入用于 GitHub 应用程序 的私钥,它包含在您创建应用程序时下载的 PEM 文件中。
-
在“Webhook Secret(web 挂钩密码)”下,输入您在创建应用程序时记录的 GitHub 应用程序 web 挂钩密码。
-
如果在安装过程中无法提供 SSL 证书,请选择 Skip SSL Certificate Check(跳过 SSL 证书检查)。
-
单击 Submit(提交)。
-
Click Log in with GitHub.
-
To authorize the GitHub 应用程序 and access GitHub Insights, click Authorize GitHub 应用程序.