From b456b5612a70c55ed68c77db9115be6be9d5a7bd Mon Sep 17 00:00:00 2001 From: Wenle Date: Fri, 3 Jan 2025 13:48:37 +0800 Subject: [PATCH] fix docker run config --- .../ros_templates/application_parameters.yaml | 78 ++++++++++--------- .computenest/ros_templates/template.yaml | 4 +- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.computenest/ros_templates/application_parameters.yaml b/.computenest/ros_templates/application_parameters.yaml index dbb032c..5dda5ff 100644 --- a/.computenest/ros_templates/application_parameters.yaml +++ b/.computenest/ros_templates/application_parameters.yaml @@ -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: @@ -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: |- + 示例项目 + 热门开源项目推荐 AssociationPropertyMetadata: Visible: Condition: @@ -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: @@ -98,10 +100,10 @@ Metadata: 'ALIYUN::ROS::Interface': ParameterGroups: - Parameters: - - RepoType - - PublicGitRepoUrl - Platform - Owner + - RepoType + - PublicGitRepoUrl - Organization - Repository Label: diff --git a/.computenest/ros_templates/template.yaml b/.computenest/ros_templates/template.yaml index cc5f0ba..c86e7ae 100644 --- a/.computenest/ros_templates/template.yaml +++ b/.computenest/ros_templates/template.yaml @@ -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 @@ -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