

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# deploy 属性
<a name="attributes-json-deploy"></a>

**重要**  
该 AWS OpsWorks Stacks 服务于 2024 年 5 月 26 日终止，新客户和现有客户均已禁用。我们强烈建议客户尽快将其工作负载迁移到其他解决方案。如果您对迁移有疑问，请通过 re [AWS : Post 或通过 Pre](https://repost.aws/) mium Su [AWS pp](https://aws.amazon.com/support) ort 与 AWS 支持 团队联系。

如果此类属性与[部署事件](workingcookbook-events.md)或[“执行配方”堆栈命令](workingstacks-commands.md)关联，则 `deploy` 属性包含已部署的每个应用程序的属性 (由应用程序的短名称命名)。每个应用程序属性包含以下属性：


****  

|  |  |  | 
| --- |--- |--- |
| [应用程序](#attributes-json-deploy-app-app) | [application\$1type](#attributes-json-deploy-app-type) | [auto\$1bundle\$1on\$1deploy](#attributes-json-deploy-app-auto) | 
| [database](#attributes-json-deploy-app-db) | [deploy\$1to](#attributes-json-deploy-app-deploy-to) | [域](#attributes-json-deploy-app-domains) | 
| [document\$1root](#attributes-json-deploy-app-root) | [environment\$1variables](#attributes-json-deploy-app-environment) | [组](#attributes-json-deploy-app-group) | 
| [keep\$1releases](#attributes-json-deploy-app-keep-releases) | [memcached](#attributes-json-deploy-app-memcached) | [migrate](#attributes-json-deploy-app-migrate) | 
| [mounted\$1at](#attributes-json-deploy-app-mounted) | [purge\$1before\$1symlink](#attributes-json-deploy-app-purge-before-symlink) | [rails\$1env](#attributes-json-deploy-app-ssl-rails) | 
| [restart\$1command](#attributes-json-deploy-app-restart) | [scm](#attributes-json-deploy-app-scm) | [ssl\$1certificate](#attributes-json-deploy-app-ssl-cert) | 
| [ssl\$1certificate\$1ca](#attributes-json-deploy-app-ssl-ca) | [ssl\$1certificate\$1key](#attributes-json-deploy-app-ssl-key) | [ssl\$1support](#attributes-json-deploy-app-ssl-supp) | 
| [堆栈](#attributes-json-deploy-app-stack) | [symlink\$1before\$1migrate](#attributes-json-deploy-app-symlink-migrate) | [symlinks](#attributes-json-deploy-app-symlinks) | 
| [用户](#attributes-json-deploy-app-user) |  |  | 

**应用程序**  <a name="attributes-json-deploy-app-app"></a>
应用程序的缩略名，如 `"simplephp"` (字符串)。  

```
node["deploy"]["appshortname"]["application"]
```

**application\$1type**  <a name="attributes-json-deploy-app-type"></a>
应用程序类型 (字符串)。可能值如下所示：  
+ `java`：Java 应用程序
+ `nodejs`：Node.js 应用程序
+ `php`：PHP 应用程序
+ `rails`：Ruby on Rails 应用程序
+ `web`：静态 HTML 页面
+ `other`：所有其他应用程序类型

```
node["deploy"]["appshortname"]["application_type"]
```

**auto\$1bundle\$1on\$1deploy**  <a name="attributes-json-deploy-app-auto"></a>
对于 Rails 应用程序，是否在部署期间执行捆绑程序 (布尔值)。  

```
node["deploy"]["appshortname"]["auto_bundle_on_deploy"]
```

**database**  <a name="attributes-json-deploy-app-db"></a>
包含连接应用程序数据库所需的信息。如果应用程序附加了数据库层， OpsWorks Stacks 会自动为这些属性分配适当的值。    
**adapter**  
数据库适配器，如 `mysql` (字符串)。  

```
node["deploy"]["appshortname"]["database"]["adapter"]
```  
**database**  <a name="attributes-json-deploy-app-db-db"></a>
数据库名称，这通常是应用程序的缩略名，如 `"simplephp"` (字符串)。  

```
node["deploy"]["appshortname"]["database"]["database"]
```  
**data\$1source\$1provider**  
数据源：`mysql` 或 `rds` (字符串)。  

```
node["deploy"]["appshortname"]["database"]["data_source_provider"]
```  
**host**  <a name="attributes-json-deploy-app-db-host"></a>
数据库主机的 IP 地址 (字符串)。  

```
node["deploy"]["appshortname"]["database"]["host"]
```  
**password**  <a name="attributes-json-deploy-app-db-pwd"></a>
数据库密码 (字符串)。  

```
node["deploy"]["appshortname"]["database"]["password"]
```  
**端口**  
数据库端口 (数字)。  

```
node["deploy"]["appshortname"]["database"]["port"]
```  
**reconnect**  <a name="attributes-json-deploy-app-db-reconnect"></a>
对于 Rails 应用程序，确定在连接不再存在时是否应重新连接应用程序 (布尔值)。  

```
node["deploy"]["appshortname"]["database"]["reconnect"]
```  
**username**  <a name="attributes-json-deploy-app-db-user"></a>
用户名称 (字符串)。  

```
node["deploy"]["appshortname"]["database"]["username"]
```

**deploy\$1to**  <a name="attributes-json-deploy-app-deploy-to"></a>
应用程序要部署到的位置，例如 `"/srv/www/simplephp"` (字符串)。  

```
node["deploy"]["appshortname"]["deploy_to"]
```

**域**  <a name="attributes-json-deploy-app-domains"></a>
应用程序的域的列表 (字符串列表)。  

```
node["deploy"]["appshortname"]["domains"]
```

**document\$1root**  <a name="attributes-json-deploy-app-root"></a>
文档根 (如果您指定非默认根) 或 null (如果您使用默认根) (字符串)。  

```
node["deploy"]["appshortname"]["document_root"]
```

**environment\$1variables**  <a name="attributes-json-deploy-app-environment"></a>
由最多 20 个属性组成的集合，这些属性表示已为应用程序定义的用户指定的应用程序环境变量。有关如何定义应用程序的环境变量的更多信息，请参阅[添加应用程序](workingapps-creating.md)。每个属性名称都设置为一个环境变量名称，并且其对应值设置为变量的值，因此您可使用以下语法引用特定值。  

```
node["deploy"]["appshortname"]["environment_variables"]["variable_name"]
```

**组**  <a name="attributes-json-deploy-app-group"></a>
应用程序的组 (字符串)。  

```
node["deploy"]["appshortname"]["group"]
```

**keep\$1releases**  <a name="attributes-json-deploy-app-keep-releases"></a>
 OpsWorks Stacks 将存储的应用程序部署数量（数字）。此属性控制您可回滚应用程序的次数。默认情况下，它设置为全局值 [deploy\$1keep\$1releases ](attributes-recipes-deploy.md#attributes-recipes-deploy-global-keep-releases) (其默认值为 5)。您可覆盖 `keep_releases` 以指定特定应用程序的已存储部署的数量。  

```
node["deploy"]["appshortname"]["keep_releases"]
```

**memcached**  <a name="attributes-json-deploy-app-memcached"></a>
包含定义 memcached 配置的两个属性。    
**host**  <a name="attributes-json-deploy-app-memcached-host"></a>
Memcached 服务器实例的 IP 地址 (字符串)。  

```
node["deploy"]["appshortname"]["memcached"]["host"]
```  
**端口**  <a name="attributes-json-deploy-app-memcached-port"></a>
memcached 服务器正在侦听的端口 (数字)。  

```
node["deploy"]["appshortname"]["memcached"]["port"]
```

**migrate**  <a name="attributes-json-deploy-app-migrate"></a>
对于 Rails 应用程序，确定是否运行迁移 (布尔值)。  

```
node["deploy"]["appshortname"]["migrate"]
```

**mounted\$1at**  <a name="attributes-json-deploy-app-mounted"></a>
应用程序的安装点 (如果您指定非默认安装点) 或 null (如果您使用默认安装点) (字符串)。  

```
node["deploy"]["appshortname"]["mounted_at"]
```

**purge\$1before\$1symlink**  <a name="attributes-json-deploy-app-purge-before-symlink"></a>
对于 Rails 应用程序，在创建符号链接之前要清除的一组路径 (字符串列表)。  

```
node["deploy"]["appshortname"]["purge_before_symlink"]
```

**rails\$1env**  <a name="attributes-json-deploy-app-ssl-rails"></a>
对于 Rails App Server 实例，为 rails 环境，如 `"production"` (字符串)。  

```
node["deploy"]["appshortname"]["rails_env"]
```

**restart\$1command**  <a name="attributes-json-deploy-app-restart"></a>
要在应用程序重新启动时运行的命令，如 `"echo 'restarting app'"`。  

```
node["deploy"]["appshortname"]["restart_command"]
```

**scm**  <a name="attributes-json-deploy-app-scm"></a>
包含一组属性，用于指定用于从其源代码控制存储库部署应用程序的信息。 OpsWorks这些属性因存储库类型而异。    
**password**  <a name="attributes-json-deploy-app-scm-pwd"></a>
密码 (对于私有存储库) 和 null (对于公共存储库) (字符串)。对于私有 Amazon S3 存储桶，该属性设置为私有密钥。  

```
node["deploy"]["appshortname"]["scm"]["password"]
```  
**存储库**  <a name="attributes-json-deploy-app-scm-repo"></a>
存储库 URL，如 `"git://github.com/amazonwebservices/opsworks-demo-php-simple-app.git"` (字符串)。  

```
node["deploy"]["appshortname"]["scm"]["repository"]
```  
**revision**  <a name="attributes-json-deploy-app-scm-revision"></a>
如果存储库具有多个分支，该属性将指定应用程序的分支或版本，如 `"version1"` (字符串)。否则，其设置为 null。  

```
node["deploy"]["appshortname"]["scm"]["revision"]
```  
**scm\$1type**  <a name="attributes-json-deploy-app-scm-type"></a>
存储库类型 (字符串)。可能值如下所示：  
+ `"git"`：Git 存储库
+ `"svn"`：Subversion 存储库
+ `"s3"`：一个 Amazon S3 存储桶
+ `"archive"`：HTTP 存档
+ `"other"`：另一个存储库类型

```
node["deploy"]["appshortname"]["scm"]["scm_type"]
```  
**ssh\$1key**  <a name="attributes-json-deploy-app-scm-key"></a>
[部署 SSH 密钥](workingapps-deploykeys.md) (对于访问私有 Git 存储库) 和 null (对于公共存储库) (字符串)。  

```
node["deploy"]["appshortname"]["scm"]["ssh_key"]
```  
**用户**  <a name="attributes-json-deploy-app-scm-user"></a>
用户名 (对于私有存储库) 和 null (对于公共存储库) (字符串)。对于私有 Amazon S3 存储桶，该属性设置为访问密钥。  

```
node["deploy"]["appshortname"]["scm"]["user"]
```

**ssl\$1certificate**  <a name="attributes-json-deploy-app-ssl-cert"></a>
应用程序的 SSL 证书 (如果您启用了 SSL 支持) 或 null (如果您未启用 SSL 支持) (字符串)。  

```
node["deploy"]["appshortname"]["ssl_certificate"]
```

**ssl\$1certificate\$1ca**  <a name="attributes-json-deploy-app-ssl-ca"></a>
如果启用 SSL，则为指定中间证书颁发机构密钥或客户端身份验证的属性 (字符串)。  

```
node["deploy"]["appshortname"]["ssl_certificate_ca"]
```

**ssl\$1certificate\$1key**  <a name="attributes-json-deploy-app-ssl-key"></a>
应用程序的 SSL 私有密钥 (如果您启用了 SSL 支持) 或 null (如果您未启用 SSL 支持) (字符串)。  

```
node["deploy"]["appshortname"]["ssl_certificate_key"]
```

**ssl\$1support**  <a name="attributes-json-deploy-app-ssl-supp"></a>
是否支持 SSL (布尔值)。  

```
node["deploy"]["appshortname"]["ssl_support"]
```

**堆栈**  <a name="attributes-json-deploy-app-stack"></a>
包含一个布尔值属性 `needs_reload`，其指定是否在部署期间重新加载应用程序服务器。  

```
node["deploy"]["appshortname"]["stack"]["needs_reload"]
```

**symlink\$1before\$1migrate**  <a name="attributes-json-deploy-app-symlink-migrate"></a>
对于 Rails 应用程序，包含要在运行迁移之前作为 `"link":"target"` 对创建的符号链接。  

```
node["deploy"]["appshortname"]["symlink_before_migrate"]
```

**symlinks**  <a name="attributes-json-deploy-app-symlinks"></a>
包含部署的作为 `"link":"target"` 对的符号链接。  

```
node["deploy"]["appshortname"]["symlinks"]
```

**用户**  <a name="attributes-json-deploy-app-user"></a>
应用程序的用户 (字符串)。  

```
node["deploy"]["appshortname"]["user"]
```