vRealize Suite Lifecycle Manager can include multiple repositories with branches on a source control server. By adding a Source Control Management (SCM) endpoint, you can check in and check out SDDC content on the source control server.

As a DevOps administrator, you create a project with a branch on the source control server. Then you assign access rights for the branch to developers. After that, you use the API to add a source control server endpoint in vRealize Suite Lifecycle Manager.

As a content developer with access rights to the branch on the source control server, you can generate a user token. Then you attach the token to the source control server and create an SCM content endpoint.

Prerequisites

  • Verify that the appliance name and fully qualified domain name of the vRealize Suite Lifecycle Manager instance are available.
  • Verify that the URL variable is assigned.
    url='https://LCM-Hostname'
  • Verify that you have correct permissions.
    • As DevOps administrator, verify that you are an organization owner in vRealize Suite Lifecycle Manager with an administrator role.
    • As a developer, verify that you are an organization owner in vRealize Suite Lifecycle Manager with a user role.
  • Verify that vRealize Suite Lifecycle Manager supports the version of the source control server that you plan to use.
    Table 1. Supported Source Control Server Versions
    SCM Server Type Version n Version (n-1)
    GitLab 12.8 12.7
    GitHub 2.20.1 2.19.8
    BitBucket Cloud Version 2.0 N/A
    Bitbucket Server 7.0 6.10

Procedure

  1. As a DevOps administrator, add a source control server endpoint in vRealize Suite Lifecycle Manager. In this example, the source control server type is GitLab. vRealize Suite Lifecycle Manager also supports GitHub, Bitbucket Cloud, and Bitbucket Server types.
    curl -X POST \
      '$url/lcm/cms/api/v1/endpoints' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json' \
      -d '{
        "sourceControlType": "gitlab",
        "endpointType": "SERVER_ENDPOINT",
        "category": "SourceControl",
        "name": "gitlab.vmware.com",
        "server": "gitlab.vmware.com"
    }' | jq "."
  2. Examine the response and note the reference ID.
    A snippet of the response shows the endpoint ID listed as the referenceID.
    {
       "requestId":"2688b287-d50c-4f89-be42-2d707af26758",
       "status":"IN_PROGRESS",
       "message":"Endpoint Successfully Created",
       "referenceId":"567a280d-3419-4eb7-81c0-219902b8447c"
    }
  3. Set up access control in GitLab for the branch.
    1. Assign access rights for the branch to your developer.
    2. Provide your developer with the ID of the source control server endpoint.
  4. As a developer with access rights to the branch on the source control server, generate a userToken with full access for source control and assign the token to a variable name.
    SourceControlAccessToken = '<userToken>'
  5. Assign the reference ID of the source control server endpoint that you received from the DevOps administrator to a variable name.
    SourceControlServerEndpointID = '<referenceID>'
  6. Attach the token to the server endpoint.
    curl -X POST \
      '$url/lcm/cms/api/v1/sourcecontrol/token/' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json' \
      -d '{
        "endpointId": "{$SourceControlServerEndpointID}",
        "token": "{$SourceControlAccessToken}"
    }' | jq "."
    Note: GitHub servers support credential-based access in addition to token-based access as shown in the following request example.
    curl -X POST \
      '$url/lcm/cms/api/v1/sourcecontrol/token/' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json' \
      -d '{
        "endpointId": "{$SourceControl_GitHubServer_EndpointID}",
        "userName": "{$SourceControlUserName}",
        "password": "{$SourceControlPassword}"
    }' | jq "."
  7. Create an SCM content endpoint to perform source control operations. In this example, you can perform operations such as checkin, checkout, and raise code reviews through the new endpoint.
    curl -X POST \
      '$url/lcm/cms/api/v1/endpoints' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json' \
      -d '{
        "tagNames": ["test123"],
        "supportCapture": true,
        "supportTest": true,
        "supportRelease": true,
        "name": "git-lab-content-endpoint",
        "category": "SourceControl",
        "sourceControlServerId": "{$SourceControlServerEndpointID}",
        "branch": "master",
        "repository": "example-test/feature",
        "server": "gitlab.vmware.com",
        "sourceControlType": "gitlab",
        "endpointType": "CONTENT_ENDPOINT"
    }' | jq "."

What to do next

Use your SCM endpoint to manage the following types of content:
  • Automation-Component Profile
  • Automation-Composite Blueprint
  • Automation-Custom Form
  • Automation-Property Definition
  • Automation-Property Group
  • Automation-Resource Map
  • Automation-Resource Type
  • Automation-Resource Action
  • Automation-Software
  • Automation-Subscription
  • Automation-XaaS Blueprint
  • Orchestrator-Package
  • vSphere-Custom Spec
  • Operations-Alert
  • Operations-Dashboard
  • Operations-Report
  • Operations-ResourceKindMetricConfig
  • Operations-SuperMetric
  • Operations-Symptom
  • Operations-TextWidgetContent
  • Operations-TopoWidgetContent
  • Operations-View