Updated on 2023-10-30 GMT+08:00

Interconnection Tests

Before the operation, test the interconnection between Jenkins and GitLab to ensure that Jenkins can access GitLab through APIs.

Generating a GitLab Access Token

  1. Log in to GitLab.
  2. Move the cursor to the account name in the upper right corner and click Edit profile.
  3. Click Access Tokens, enter Token name, select api, and click Create personal access token.

    The token will be displayed on the right of Personal Access Tokens.

    The token is displayed only when it is generated for the first time. Otherwise, you need to create it again next time. This token is used only for GitLab interconnection tests.

Testing the Interconnection Between Jenkins and GitLab

  1. Enter http://{IP address of the Linux VM where Jenkins is installed}:8080 in the address box of the browser to log in to Jenkins.
  2. Choose Manage Jenkins > Jenkins Configuration. In Configuration, select Gitlab.
  3. Configure the GitLab URL, click Add under Credentials, and select Jenkins.
  4. Select Username with password from the drop-down list, select Gitlab API token, and configure the GitLab access token in Generating a GitLab Access Token to the API token.
  5. Select Gitlab API token for Credentials and click Test Connection. If Success is displayed, the interconnection is successful.