Update docs
This commit is contained in:
parent
afb2bd9ab8
commit
95379b81bc
4 changed files with 40 additions and 3 deletions
|
|
@ -288,7 +288,7 @@ func (s *OrgTestSuite) TestListOrganizationsDBFetchErr() {
|
|||
|
||||
s.assertSQLMockExpectations()
|
||||
s.Require().NotNil(err)
|
||||
s.Require().Equal("fetching user from database: fetching user from database mock error", err.Error())
|
||||
s.Require().Equal("fetching org from database: fetching user from database mock error", err.Error())
|
||||
}
|
||||
|
||||
func (s *OrgTestSuite) TestDeleteOrganization() {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,19 @@
|
|||
# Configuring github credentials
|
||||
|
||||
Garm needs a [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to create runner registration tokens, list current self hosted runners and potentially remove them if they become orphaned (the VM was manually removed on the provider).
|
||||
The ```github``` config section holds credentials and API endpoint information for accessing the GitHub APIs. Credentials are tied to the instance of GitHub you're using. Whether you're using [github.com](https://github.com) or your own deployment of GitHub Enterprise server, this section is how ```garm``` knows where it should create the runners.
|
||||
|
||||
Tying the API endpoint info to the credentials allows us to use the same ```garm``` installation with both [github.com](https://github.com) and private deployments. All you have to do is to add the needed endpoint info (see bellow).
|
||||
|
||||
|
||||
Garm uses a [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) to create runner registration tokens, list current self hosted runners and potentially remove them if they become orphaned (the VM was manually removed on the provider).
|
||||
|
||||
|
||||
From the list of scopes, you will need to select:
|
||||
|
||||
* ```public_repo``` - for access to a repository
|
||||
* ```repo``` - for access to a private repository
|
||||
* ```admin:org``` - if you plan on using this with an organization to which you have access
|
||||
* ```manage_runners:enterprise``` - if you plan to use garm at the enterprise level
|
||||
|
||||
The resulting token must be configured in the ```[[github]]``` section of the config. Sample as follows:
|
||||
|
||||
|
|
@ -24,6 +31,21 @@ The resulting token must be configured in the ```[[github]]``` section of the co
|
|||
# to work with repositories, and the admin:org needs to be set if you plan on
|
||||
# adding an organization.
|
||||
oauth2_token = "super secret token"
|
||||
# base_url (optional) is the URL at which your GitHub Enterprise Server can be accessed.
|
||||
# If these credentials are for github.com, leave this setting blank
|
||||
base_url = "https://ghe.example.com"
|
||||
# api_base_url (optional) is the base URL where the GitHub Enterprise Server API can be accessed.
|
||||
# Leave this blank if these credentials are for github.com.
|
||||
api_base_url = "https://ghe.example.com"
|
||||
# upload_base_url (optional) is the base URL where the GitHub Enterprise Server upload API can be accessed.
|
||||
# Leave this blank if these credentials are for github.com, or if you don't have a separate URL
|
||||
# for the upload API.
|
||||
upload_base_url = "https://api.ghe.example.com"
|
||||
# ca_cert_bundle (optional) is the CA certificate bundle in PEM format that will be used by the github
|
||||
# client to talk to the API. This bundle will also be sent to all runners as bootstrap params.
|
||||
# Use this option if you're using a self signed certificate.
|
||||
# Leave this blank if you're using github.com or if your certificare is signed by a valid CA.
|
||||
ca_cert_bundle = "/etc/garm/ghe.crt"
|
||||
```
|
||||
|
||||
The double paranthesis means that this is an array. You can specify the ```[[github]]``` section multiple times, with different tokens from different users, or with different access levels. You will then be able to list the available credentials using the API, and reference these credentials when adding repositories or organizations.
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ Pools are objects that define one type of worker and rules by which that pool of
|
|||
Before we can create a pool, we need to list the available providers. Providers are defined in the config (see above), but we need to reference them by name in the pool.
|
||||
|
||||
```bash
|
||||
ubuntu@experiments:~$ garm-cli provider list
|
||||
ubuntu@experiments:~$ garm-cli provider list
|
||||
+-----------+------------------------+------+
|
||||
| NAME | DESCRIPTION | TYPE |
|
||||
+-----------+------------------------+------+
|
||||
|
|
|
|||
15
testdata/config.toml
vendored
15
testdata/config.toml
vendored
|
|
@ -192,3 +192,18 @@ provider_type = "external"
|
|||
# to work with repositories, and the admin:org needs to be set if you plan on
|
||||
# adding an organization.
|
||||
oauth2_token = "super secret token"
|
||||
# base_url (optional) is the URL at which your GitHub Enterprise Server can be accessed.
|
||||
# If these credentials are for github.com, leave this setting blank
|
||||
base_url = "https://ghe.example.com"
|
||||
# api_base_url (optional) is the base URL where the GitHub Enterprise Server API can be accessed.
|
||||
# Leave this blank if these credentials are for github.com.
|
||||
api_base_url = "https://ghe.example.com"
|
||||
# upload_base_url (optional) is the base URL where the GitHub Enterprise Server upload API can be accessed.
|
||||
# Leave this blank if these credentials are for github.com, or if you don't have a separate URL
|
||||
# for the upload API.
|
||||
upload_base_url = "https://api.ghe.example.com"
|
||||
# ca_cert_bundle (optional) is the CA certificate bundle in PEM format that will be used by the github
|
||||
# client to talk to the API. This bundle will also be sent to all runners as bootstrap params.
|
||||
# Use this option if you're using a self signed certificate.
|
||||
# Leave this blank if you're using github.com or if your certificare is signed by a valid CA.
|
||||
ca_cert_bundle = "/etc/garm/ghe.crt"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue