Skip to content

Commit

Permalink
Github actions auto update oos templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ceshihao committed Nov 10, 2024
1 parent 1cdf004 commit 109afb3
Show file tree
Hide file tree
Showing 13 changed files with 449 additions and 253 deletions.
312 changes: 177 additions & 135 deletions list-templates.json

Large diffs are not rendered by default.

69 changes: 0 additions & 69 deletions templates/ACS-ALB-BulkyEnableDeletionProtection.yaml
Original file line number Diff line number Diff line change
@@ -1,69 +0,0 @@
FormatVersion: OOS-2019-06-01
Description:
en: Bulky set loadbalancer deletion protection
zh-cn: 批量启用应用型负载均衡实例删除保护
name-en: ACS-ALB-BulkyEnableDeletionProtection
name-zh-cn: 批量启用应用型负载均衡实例删除保护
categories:
- security
Parameters:
regionId:
Type: String
Label:
en: RegionId
zh-cn: 地域ID
AssociationProperty: RegionId
Default: '{{ ACS::RegionId }}'
loadBalancerIds:
Label:
en: LoadBalancerIds
zh-cn: 应用型负载均衡实例ID列表
Type: List
rateControl:
Label:
en: RateControl
zh-cn: 任务执行的并发比率
Type: Json
AssociationProperty: RateControl
Default:
Mode: Concurrency
MaxErrors: 0
Concurrency: 10
OOSAssumeRole:
Label:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: enableDeletionProtection
Action: ACS::ExecuteAPI
Description:
en: Set loadBalancer deletion protection
zh-cn: 应用负载均衡实例启用实例保护
Properties:
Service: ALB
API: EnableDeletionProtection
Parameters:
RegionId: '{{ regionId }}'
ResourceId: '{{ ACS::TaskLoopItem }}'
Loop:
RateControl: '{{ rateControl }}'
Items: '{{ loadBalancerIds }}'
Metadata:
ALIYUN::OOS::Interface:
ParameterGroups:
- Parameters:
- regionId
- loadBalancerIds
Label:
default:
zh-cn: 选择实例
en: Select Loadbalancer
- Parameters:
- rateControl
- OOSAssumeRole
Label:
default:
zh-cn: 高级选项
en: Control Options
20 changes: 20 additions & 0 deletions templates/ACS-ECS-BulkyCopyImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ Parameters:
AssociationProperty: 'ALIYUN::ECS::Image::ImageId'
AssociationPropertyMetadata:
RegionId: regionId
SupportedImageOwnerAlias:
- self
targetImageName:
Label:
en: Target image name
zh-cn: 目标镜像名
Type: String
Default: ''
targetImageDescription:
Label:
en: Target image describe
zh-cn: 镜像描述
Type: String
Default: ''
targetRegionIds:
Label:
en: TargetRegionIds
Expand Down Expand Up @@ -121,6 +135,8 @@ Tasks:
regionId: '{{ regionId }}'
imageId: '{{ imageId }}'
targetRegionId: '{{ ACS::TaskLoopItem }}'
targetImageName: '{{ targetImageName }}'
targetImageDescription: '{{ targetImageDescription }}'
Loop:
Items: '{{ targetRegionIds }}'
RateControl: '{{ rateControl }}'
Expand All @@ -141,6 +157,8 @@ Tasks:
regionId: '{{ regionId }}'
imageId: '{{ imageId }}'
targetRegionId: '{{ ACS::TaskLoopItem }}'
targetImageName: '{{ targetImageName }}'
targetImageDescription: '{{ targetImageDescription }}'
Loop:
Items: '{{ queryAllAvailableRegions.regionIds }}'
RateControl: '{{ rateControl }}'
Expand Down Expand Up @@ -169,6 +187,8 @@ Metadata:
- regionId
- imageId
- targetRegionIds
- targetImageName
- targetImageDescription
Label:
default:
zh-cn: 配置参数
Expand Down
94 changes: 59 additions & 35 deletions templates/ACS-ECS-LocalBuildAndDeployOnSingleECS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Parameters:
Label:
en: Platform
zh-cn: 平台
AssociationProperty: ALIYUN::OOS::GitPlatform::Name
AssociationProperty: 'ALIYUN::OOS::GitPlatform::Name'
Default: github
AllowedValues:
- github
Expand All @@ -20,29 +20,29 @@ Parameters:
Label:
en: Owner
zh-cn: 所有者
AssociationProperty: ALIYUN::OOS::GitAccount::Name
AssociationProperty: 'ALIYUN::OOS::GitAccount::Name'
AssociationPropertyMetadata:
Platform: ${platform}
Platform: '${platform}'
organization:
Type: String
Label:
en: Organization
zh-cn: 组织
Default: ''
AssociationProperty: ALIYUN::OOS::GitOrganization::Name
AssociationProperty: 'ALIYUN::OOS::GitOrganization::Name'
AssociationPropertyMetadata:
Platform: ${platform}
Owner: ${owner}
Platform: '${platform}'
Owner: '${owner}'
repository:
Type: String
Label:
en: Repository
zh-cn: 仓库
AssociationProperty: ALIYUN::OOS::GitRepository::Name
AssociationProperty: 'ALIYUN::OOS::GitRepository::Name'
AssociationPropertyMetadata:
Platform: ${platform}
Organization: ${organization}
Owner: ${owner}
Platform: '${platform}'
Organization: '${organization}'
Owner: '${owner}'
instanceId:
Label:
en: InstanceId
Expand All @@ -55,15 +55,15 @@ Parameters:
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${platform}
'Fn::Equals':
- '${platform}'
- Null
branch:
Label:
en: Branch
zh-cn: 分支
Description:
en: Branch, pull default branch if not set
en: 'Branch, pull default branch if not set'
zh-cn: 代码仓库分支,不填拉取默认分支
Type: String
Default: ''
Expand All @@ -72,16 +72,23 @@ Parameters:
en: Download Path
zh-cn: 下载路径
Description:
en: The path to download the code. If not set, it will be downloaded to /root/workspace/{current execution ID}. If you need to specify a path, please ensure that the path you provide does not have files, otherwise it will fail to pull.
zh-cn: 将代码下载到您的ECS上的路径。【不填默认下载到/root/workspace/{当前执行的ID}。如您需指定路径,请确保您提供的路径下没有文件,否则会拉取失败。】
en: >-
The path to download the code. If not set, it will be downloaded to
/root/workspace/{current execution ID}. If you need to specify a path,
please ensure that the path you provide does not have files, otherwise
it will fail to pull.
zh-cn: >-
将代码下载到您的ECS上的路径。【不填默认下载到/root/workspace/{当前执行的ID}。如您需指定路径,请确保您提供的路径下没有文件,否则会拉取失败。】
Type: String
Default: ''
isDockerBuild:
Label:
en: IsDockerBuild
zh-cn: 是否使用Docker构建
Description:
en: If yes, it will detect if Docker is already installed on your ECS, and if not, it will be installed automatically for you.
en: >-
If yes, it will detect if Docker is already installed on your ECS, and
if not, it will be installed automatically for you.
zh-cn: 如果选择是,会检测您的ECS上是否已安装Docker,如果没有会为您自动安装。
Type: Boolean
Default: false
Expand All @@ -90,17 +97,19 @@ Parameters:
en: buildAndDeployScript
zh-cn: 构建部署脚本
Description:
en: Script execution takes the root directory of the code as its working directory.
en: >-
Script execution takes the root directory of the code as its working
directory.
zh-cn: 脚本执行会以您指定的下载路径作为工作路径。
Type: String
MaxLength: 16384
AssociationProperty: ALIYUN::OOS::Command::CommandContent
AssociationProperty: 'ALIYUN::OOS::Command::CommandContent'
AssociationPropertyMetadata:
CommandType: RunShellScript
Value:
- Condition:
Fn::Equals:
- ${isDockerBuild}
'Fn::Equals':
- '${isDockerBuild}'
- true
Value: |-
##### Sample Java Deploy Script
Expand All @@ -122,30 +131,44 @@ Parameters:
##### end
- Condition:
Fn::Equals:
- ${isDockerBuild}
'Fn::Equals':
- '${isDockerBuild}'
- false
Value: |-
Value: >-
##### Sample Java Deploy Script
##### for ECS on Alibaba Cloud Linux 3.2104
### Build jar file.
# set -e
# yum install -y maven-3.5.4
# mvn package
### Stop the previous version of the application (if any) and deploy the current version.
# PID=$(ps -ef | grep "sample-spring-1.0-SNAPSHOT.jar" | grep -v "grep" | awk '{print $2}')
### Stop the previous version of the application (if any) and deploy
the current version.
# PID=$(ps -ef | grep "sample-spring-1.0-SNAPSHOT.jar" | grep -v
"grep" | awk '{print $2}')
# if [ -n "$PID" ]; then
# kill -9 $PID
# fi
# java -jar target/sample-spring-1.0-SNAPSHOT.jar &
##### end
RamRole: ''
Tasks:
- Name: GitCodeRepo
Action: ACS::CICD::GitCodeRepo
Action: 'ACS::CICD::GitCodeRepo'
Description: 指定代码源,生成临时授权链接
Properties:
organization: '{{ organization }}'
Expand All @@ -157,7 +180,7 @@ Tasks:
Type: String
ValueSelector: authorizedUrl
- Name: LocalBuildAndDeploy
Action: ACS::CICD::LocalBuildAndDeploy
Action: 'ACS::CICD::LocalBuildAndDeploy'
Description: 拉取代码,构建并部署应用
Properties:
instanceId: '{{ instanceId }}'
Expand All @@ -168,10 +191,10 @@ Tasks:
buildAndDeployScript: '{{ buildAndDeployScript }}'
regionId: '{{ ACS::RegionId }}'
workingDir:
Fn::If:
- Fn::Equals:
- '{{ downloadPath }}'
- ''
'Fn::If':
- 'Fn::Equals':
- '{{ downloadPath }}'
- ''
- '/root/workspace/{{ACS::ExecutionId}}'
- '{{ downloadPath }}'
Outputs:
Expand All @@ -188,7 +211,7 @@ Tasks:
Type: String
ValueSelector: buildAndDeployOutput
Metadata:
ALIYUN::OOS::Interface:
'ALIYUN::OOS::Interface':
ParameterGroups:
- Parameters:
- platform
Expand All @@ -208,3 +231,4 @@ Metadata:
default:
zh-cn: 构建部署配置
en: Build and Deploy Configuration

4 changes: 2 additions & 2 deletions templates/ACS-ECS-ScheduleToUpgradeInternetBandwidth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ Parameters:
en: The maximum public network bandwidth for out-direction
zh-cn: 公网最大出带宽
Description:
en: <p>Unit:Mbit/s (Megabit per second), value range: 0~100,OOS does not validate the maxBandwidthOut parameter value. <br/><font color='red'>If the value exceeded 100,bandwidth upgrade task may fail, you can submit a ticket to ECS to raise the maximum bandwidth and then use OOS to upgrade or modify the bandwidth parameter in limit range.</font></p>
zh-cn: <p>单位:Mbit/s(Megabit per second),取值范围:0~100,系统运维管理不对带宽值入参进行校验。<br/><font color='red'>如果您设置的带宽值超过100,带宽临时升级可能会失败,您可以在ECS控制台提交工单提高带宽峰值后使用系统运维管理进行升级,或者将带宽值修改到限制范围内。</font></p>
en: <p>Unit:Mbit/s (Megabit per second), value range: 0~200,OOS does not validate the maxBandwidthOut parameter value. <br/><font color='red'>If the value exceeded 100,bandwidth upgrade task may fail, you can submit a ticket to ECS to raise the maximum bandwidth and then use OOS to upgrade or modify the bandwidth parameter in limit range.</font></p>
zh-cn: <p>单位:Mbit/s(Megabit per second),取值范围:0~200,系统运维管理不对带宽值入参进行校验。<br/><font color='red'>如果您设置的带宽值超过200,带宽临时升级可能会失败,您可以在ECS控制台提交工单提高带宽峰值后使用系统运维管理进行升级,或者将带宽值修改到限制范围内。</font></p>
Type: Number
MinValue: 0
Default: 10
Expand Down
15 changes: 15 additions & 0 deletions templates/ACS-ECS-UpdateImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ Parameters:
RegionId: regionId
InstanceType: instanceType
Default: cloud_essd
systemDiskSize:
Label:
en: SystemDiskSize
zh-cn: 系统盘大小
Description:
zh-cn: 系统盘大小,单位GB,普通云盘容量:20-500G,ESSD云盘PL0:1-2048G,ESSD云盘PL1:20-2048G,ESSD云盘PL2:461-2048G,ESSD云盘PL3:1261-2048G,ESSD AutoPL云盘:1-2048G,其他云盘类型:20-2048G.
en: 'System disk size, in GB, regular cloud: 20-500G, cloud_essd PL0:1-2048G, cloud_essd PL1:20-2048G, cloud_essd PL2:461-2048G, cloud_essd PL3:1261-2048G, ESSD AutoPL cloud disk: 1-2048G, other cloud disk types: 20-2048G.'
ConstraintDescription:
zh-cn: 必须输入整数,单位GB
en: 'Must be an integer.'
Type: String
Default: ''
commandType:
Label:
en: CommandType
Expand Down Expand Up @@ -409,6 +421,7 @@ Tasks:
internetMaxBandwidthOut: '{{ internetMaxBandwidthOut }}'
ramRoleName: '{{ ramRoleName }}'
systemDiskCategory: '{{ systemDiskCategory }}'
systemDiskSize: '{{ systemDiskSize }}'
Outputs:
instanceId:
ValueSelector: instanceIds[0]
Expand Down Expand Up @@ -540,6 +553,7 @@ Metadata:
- vSwitchId
- internetMaxBandwidthOut
- systemDiskCategory
- systemDiskSize
- ramRoleName
Label:
default:
Expand All @@ -563,3 +577,4 @@ Metadata:
default:
zh-cn: 高级选项
en: Control Options

6 changes: 3 additions & 3 deletions templates/ACS-ENS-BulkyQueryDisksAttributes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Parameters:
en: OOSAssumeRole
zh-cn: OOS扮演的RAM角色
Type: String
Default: ""
RamRole: "{{ OOSAssumeRole }}"
Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
- Name: getDisks
Description:
en: Views the ENS disks
zh-cn: 获取ENS磁盘
Action: ACS::ENS::QueryDisksInfo
Action: 'ACS::ENS::QueryDisksInfo'

Loading

0 comments on commit 109afb3

Please sign in to comment.