Usage
Generates a URL for the code in a specified GitHub or Gitee repository.
Syntax
Tasks:
- Name: GitCodeRepo
Action: ACS::GitCodeRepo
Description: Specifies the code source and generates a temporary authorization link.
Properties:
Platform: github # Required. The platform. Valid values: github, gitee.
Owner: your-github-user-name # Required. The GitHub account name.
Organization: your-github-organization # Optional. The organization name.
Repository: your-github-repository # Required. The repository name.
Outputs:
authorizedUrl: # The URL of the code in the specified GitHub or Gitee repository.
Type: String
ValueSelector: AuthorizedUrl # The jq selector syntax. The task's return value is used as the JSON input. For more information about the jq syntax, see https://stedolan.github.io/jq.
Notes
-
You must grant authorization before use. When you create a template or run a task, follow the prompts to complete the authorization.
-
The output is a URL, such as:
https://your_***@github.com/owner/repo
Use this URL to clone code. For 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: Specifies the code source and generates a temporary authorization link.
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:
en: Execute clone code command
zh-cn: Execute the clone code command
Properties:
instanceId: '{{ instanceId }}'
commandType: RunShellScript
commandContent: |-
git clone '{{ GitCodeRepo.authorizedUrl }}' .
该文章对您有帮助吗?