GitBook: [#210] GitLab Agent Configuration

This commit is contained in:
Nate Danner
2022-12-28 19:11:13 +00:00
committed by gitbook-bot
parent 341b335e2f
commit c91ab5fa71
10 changed files with 83 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -18,6 +18,7 @@
* [Standard configuration](how-to/on-premise-agent/standard-configuration.md)
* [Configure an agent with Bitbucket access](how-to/on-premise-agent/configure-bitbucket-to-agent.md)
* [Configure an agent with GitHub](how-to/on-premise-agent/configure-an-agent-with-github.md)
* [Configure an agent with GitLab](how-to/on-premise-agent/configure-an-agent-with-gitlab.md)
* [Artifact Repository Integration](how-to/on-premise-agent/maven-repository-integration/README.md)
* [Maven repository integration overview](how-to/on-premise-agent/maven-repository-integration/maven-repository-integration-overview.md)
* [Configure an agent with Maven repository access](how-to/on-premise-agent/maven-repository-integration/configure-an-agent-with-maven-repository-access.md)

View File

@@ -18,7 +18,7 @@ This guide will walk you through configuring a new OAuth Application in GitHub
3. Click the `New OAuth App` button in the upper right of your screen.
4. Supply the required fields and Register the application. (See examples below) ![](<../../.gitbook/assets/Screen Shot 2022-05-19 at 1.01.11 PM.png>)
5. On your newly created application click the `Generate a new client secret` button\
![](<../../.gitbook/assets/Screen Shot 2022-05-19 at 1.17.35 PM.png>)
![](<../../.gitbook/assets/Screen Shot 2022-05-19 at 1.17.35 PM (1).png>)
6. Copy the Client ID and Client secret from this page; they will be used as arguments for the Moderne Agent. &#x20;
#### **Example values**

View File

@@ -0,0 +1,79 @@
# Configure an agent with GitLab
Configuring your Moderne Agent instance with GitLab is a prerequisite for both viewing recipe results within the Moderne application and committing changes from a recipe.\
This guide will walk you through configuring a new OAuth Application in GitLab
**Prerequisites**
* Administrator access to your organization's GitLab account.
#### Step 1 - Create an OAuth application with application id and secret.
1. Navigate to the Applications page for your organization: `https://gitlab.com/groups/<yourorg>/-/settings/applications`
2. Provide an application name and redirect URI.\
The redirect URI will be in this format: `https://<tenantname>.moderne.io`
<figure><img src="../../.gitbook/assets/Screenshot 2022-12-27 at 8.59.50 AM (1).png" alt=""><figcaption></figcaption></figure>
3. Supply the following selections &#x20;
<figure><img src="../../.gitbook/assets/Screenshot 2022-12-27 at 7.52.35 AM.png" alt=""><figcaption></figcaption></figure>
4. Click the Save application button
5. Copy the application ID and secret from this page; they will be used as arguments for the Moderne Agent. \
<figure><img src="../../.gitbook/assets/Screenshot 2022-12-27 at 8.03.35 AM.png" alt=""><figcaption></figcaption></figure>
#### Step 2 - Configure the Moderne Agent arguments
Please note that the commands and options below omit standard options documented at [standard-configuration.md](standard-configuration.md "mention"). You will need to merge the standard options into the commands documented below, which are indicated via ellipses.
{% tabs %}
{% tab title="OCI Container" %}
You can configure multiple GitLab OAuth Apps by including multiple entries with different indices. The Client ID and secret of each index must match up with the host for that index.
* `MODERNE_AGENT_GITLAB_{index}_OAUTH_CLIENTID` - Application id configured in the previous step
* `MODERNE_AGENT_GITLAB_{index}_OAUTH_CLIENTSECRET` - Secret configured in the previous step
* `MODERNE_AGENT_GITLAB_{index}_URL` - fully-qualified hostname of running GitLab instance
* `MODERNE_AGENT_GITLAB_{index}_SKIPSSL` - skip SSL validation for HTTP connections to this GitLab instance (defaults to false)
Example (note that host, client id, and client secret are fake):
```
docker run \
...
-e MODERNE_AGENT_GITLAB_0_OAUTH_CLIENTID=ABCDE\
-e MODERNE_AGENT_GITLAB_0_OAUTH_CLIENTSECRET=d70a0527 \
-e MODERNE_AGENT_GITLAB_0_URL=https://gitlab.com \
...
```
{% endtab %}
{% tab title="Executable JAR" %}
You can configure multiple GitHub OAuth Apps by including multiple entries with different indices. The private key of each index must match up with the host for that index.
* `moderne.agent.gitlab[{index}].oauth.clientId` - Application id configured in the previous step
* `moderne.agent.gitlab[{index}].oauth.clientSecret` - Secret configured in the previous step
* `moderne.agent.gitlab[{index}].url` - fully-qualified hostname of running GitLab instance
* `moderne.agent.gitlab[{index}].skipSsl` - skip SSL validation for HTTP connections to this GitLab instance (defaults to false)
Note: system properties can be used in place of arguments. As an example, use `-Dmoderne.agent.token={token_value}` as an argument instead of `--moderne.agent.token={token_value}` as an argument.
Example (note that host, client id, and client secret are fake):
```
java -jar moderne-agent-{version}.jar \
...
--moderne.agent.gitlab[0].oauth.clientId=ABCDE \
--moderne.agent.gitlab[0].oauth.clientSecret=d70a0527 \
--moderne.agent.gitlab[0].url=https://gitlab.com \
...
```
{% endtab %}
{% endtabs %}

View File

@@ -4,7 +4,7 @@ Maven repositories are potential sources of both Abstract Syntax Tree (AST) arti
A particular Maven repository may contain either ASTs or recipe artifacts, or a mixture of both. Several open source and commercial products exist to serve artifacts using the Maven repository format. A single instance of one of these products may contain multiple Maven repositories.
![](<../../../.gitbook/assets/image (12) (1).png>)![](<../../../.gitbook/assets/image (4) (1) (1).png>)
![](<../../../.gitbook/assets/image (12) (1).png>)![](<../../../.gitbook/assets/image (21).png>)
### Comparison of two Maven integrations

View File

@@ -26,7 +26,7 @@ This guide assumes that you:
1. Click the [Repository Group](../references/managing-repository-groups.md) selector on the right-hand side of the header and create a new group of your selected repositories.\
<figure><img src="../.gitbook/assets/Screenshot 2022-12-02 at 9.28.28 AM.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/Screenshot 2022-12-02 at 9.28.28 AM (1).png" alt=""><figcaption></figcaption></figure>
2. Navigate to the recipe you wish to run and fill out the recipe options.\