All Products
Search
Document Center

CloudOps Orchestration Service:ACS::GitCodeRepo

Last Updated:Sep 14, 2024

Description

Generates a URL of the user-specified GitHub or Gitee code repository.

Syntax

Tasks:
  - Name: GitCodeRepo
    Action: ACS::GitCodeRepo
    Description: Generate a temporary authorized URL of the specified code repository
    Properties:
      Platform: github # Required. The platform. Valid values: github and gitee.
      Owner: your-github-user-name # Required. The name of the GitHub account.
      Organization: your-github-organization # Optional. The name of the organization.
      Repository: your-github-repository # Required. The name of the repository.
    Outputs:
      authorizedUrl: # The URL of the specified GitHub or Gitee code repository.
        Type: String
        ValueSelector: AuthorizedUrl # The jQuery selector for selecting the required information from the JSON data returned for the task. For more information about the syntax of jQuery selectors, visit https://stedolan.github.io/jq

.

Usage notes

  • Authorization is required to use this action. When you create a template or an execution, pay attention to the reminders and complete authorization as prompted.

  • The output is a URL. Example:

https://your_***@github.com/owner/repo

The URL can be used to pull code. Example:

git clone https://your_***@github.com/owner/repo .

Example

FormatVersion: OOS-2019-06-01
Parameters:
  instanceId:
    Description: the instance id that you will start.
    Type: String
Tasks:
  - Name: GitCodeRepo
    Action: ACS::GitCodeRepo
    Description: Generate a temporary authorized URL of the specified code repository
    Properties:
      Platform: github
      Owner: your-github-user-name
      Organization: your-github-organization
      Repository: your-github-repository
    Outputs:
      authorizedUrl:
        Type: String
        ValueSelector: AuthorizedUrl
  - Name: CloneCode
    Action: ACS::ECS::RunCommand
    Description: Execute clone code command
    Properties:
      instanceId: '{{ instanceId }}'
      commandType: RunShellScript
      commandContent: |-
        git clone '{{ GitCodeRepo.authorizedUrl }}' .