Skip to content

Commit

Permalink
fix docker run config
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenle committed Jan 3, 2025
1 parent 7ec1ead commit b456b56
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 40 deletions.
78 changes: 40 additions & 38 deletions .computenest/ros_templates/application_parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Platform:
Type: String
Label:
en: Git platform
zh-cn: Git平台
Default: github
AllowedValues:
- gitee
- github
AssociationProperty: ALIYUN::OOS::GitPlatform::Name
Owner:
Type: String
Label:
en: Git platform account
zh-cn: Git平台账户
AssociationProperty: ALIYUN::OOS::GitAccount::Name
AssociationPropertyMetadata:
Platform: '${Platform}'
RepoType:
Type: String
Label:
Expand All @@ -11,16 +29,30 @@ Parameters:
Default: Public
AssociationPropertyMetadata:
ValueLabelMapping:
Public: 公开
Private: 私有
Public: 公开仓库
Private: 个人或组织的私有仓库
PublicGitRepoUrl:
Type: String
Label:
zh-cn: Git Clone URL
en: Git Clone Web URL
zh-cn: Git Clone地址(https)
en: Git Clone URL(https)
Description:
zh-cn: Git clone地址,https格式
en: Git clone address in https format
en:
zh-cn: |-
示例项目<ul>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">Java SpringBoot</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">Python示例</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">Golang示例</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">NodeJs示例</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">Ruby示例</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
</ul>
热门开源项目推荐<ul>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">热门项目1</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">热门项目2</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">热门项目3</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">热门项目4</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
<li><a href="https://gitee.com/aliyun-computenest/java-springboot-demo" target="_blank">热门项目5</a>: https://gitee.com/aliyun-computenest/java-springboot-demo.git</li>
</ul>
AssociationPropertyMetadata:
Visible:
Condition:
Expand All @@ -30,36 +62,6 @@ Parameters:
# 需要允许默认空值,这样CommitHash的AssociationProperty可以识别出用RepoUrl还是其他参数
AllowedPattern: '^(https:\/\/[^\s]+\.git)?$'
Default: https://gitee.com/aliyun-computenest/springboot-demo.git
Platform:
Type: String
Label:
en: Git platform
zh-cn: Git平台
Default: github
AllowedValues:
- gitee
- github
AssociationProperty: ALIYUN::OOS::GitPlatform::Name
AssociationPropertyMetadata:
Visible:
Condition:
'Fn::Equals':
- '${RepoType}'
- 'Private'
Owner:
Type: String
Label:
en: Owner
zh-cn: 所有者
AssociationProperty: ALIYUN::OOS::GitAccount::Name
AssociationPropertyMetadata:
Platform: '${Platform}'
Visible:
Condition:
'Fn::Equals':
- '${RepoType}'
- 'Private'
Default: ''
Organization:
Type: String
Label:
Expand Down Expand Up @@ -98,10 +100,10 @@ Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- RepoType
- PublicGitRepoUrl
- Platform
- Owner
- RepoType
- PublicGitRepoUrl
- Organization
- Repository
Label:
Expand Down
4 changes: 2 additions & 2 deletions .computenest/ros_templates/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Resources:
mkdir -p /opt/applicationmanager
touch /opt/applicationmanager/app.env
yum install -y jq
echo ${EnvVar} | jq -r '.[] | to_entries | .[] | "\(.key)=\(.value)"' >> /opt/applicationmanager/app.env
echo '${EnvVar}' | jq -r '.[] | to_entries | .[] | "\(.key)=\(.value)"' >> /opt/applicationmanager/app.env

# 停止已有的服务
systemctl stop aliyun-applicationmanager
Expand All @@ -347,7 +347,7 @@ Resources:
Restart=always
RemainAfterExit=yes
WorkingDirectory=/opt/applicationmanager
ExecStart=docker run --name applicationmanager --rm --network=host --env-file app.env ${ImagePullPath}
ExecStart=docker run --name applicationmanager --rm -p ${Port}:${Port} --env-file app.env ${ImagePullPath}
ExecStop=docker stop -t 10 applicationmanager
TimeoutStartSec=0

Expand Down

0 comments on commit b456b56

Please sign in to comment.