

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

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

**重要**  
 AWS OpsWorks Stacks 此服務已於 2024 年 5 月 26 日終止，並已針對新客戶和現有客戶停用。我們強烈建議客戶盡快將其工作負載遷移至其他解決方案。如果您對遷移有任何疑問，請透過 [AWS re：Post](https://repost.aws/) 或透過 [AWS Premium Support](https://aws.amazon.com/support) 聯絡 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) | 
| [資料庫](#attributes-json-deploy-app-db) | [deploy\$1to](#attributes-json-deploy-app-deploy-to) | [domains](#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) | 
| [user](#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 應用程式，是否在部署期間執行 bundler (布林值)。  

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

**資料庫**  <a name="attributes-json-deploy-app-db"></a>
包含連線應用程式資料庫所需的資訊。如果應用程式已連接資料庫層， OpsWorks Stacks 會自動將適當的值指派給這些屬性。    
**adapter**  
資料庫轉接器，例如 `mysql` (字串)。  

```
node["deploy"]["appshortname"]["database"]["adapter"]
```  
**資料庫**  <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"]
```  
**託管**  <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"]
```  
**port**  
資料庫連接埠 (數值)。  

```
node["deploy"]["appshortname"]["database"]["port"]
```  
**reconnect**  <a name="attributes-json-deploy-app-db-reconnect"></a>
若為 Rails 應用程式，當連線不再存在時，是否應該重新連線應用程式 (布林值)。  

```
node["deploy"]["appshortname"]["database"]["reconnect"]
```  
**使用者名稱**  <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"]
```

**domains**  <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>
最多二十個屬性的集合，代表已為應用程式定義之使用者指定的環境變數。如需如何定義應用程式環境變數的詳細資訊，請參閱[新增應用程式](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>
Stacks OpsWorks 將存放的應用程式部署數目 （數目）。此屬性控制您可以轉返應用程式的次數。根據預設，它設定為全球值 [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 組態的兩個屬性。    
**託管**  <a name="attributes-json-deploy-app-memcached-host"></a>
Memcached 伺服器執行個體的 IP 地址 （字串）。  

```
node["deploy"]["appshortname"]["memcached"]["host"]
```  
**port**  <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 應用程式會先清除路徑陣列，再建立 symlinks (字串清單)。  

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

**rails\$1env**  <a name="attributes-json-deploy-app-ssl-rails"></a>
對於 Rails App Server 執行個體，導軌環境，例如 `"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"]
```  
**repository**  <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"]
```  
**修訂**  <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>
用來存取私有 Git 儲存庫的[部署 SSH 金鑰](workingapps-deploykeys.md)，公有儲存庫則為 null (字串)。  

```
node["deploy"]["appshortname"]["scm"]["ssh_key"]
```  
**user**  <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 (字串)。  

```
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 (字串)。  

```
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 應用程式包含的 symlink，要先建立再當成 `"link":"target"` 配對執行遷移。  

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

**symlinks**  <a name="attributes-json-deploy-app-symlinks"></a>
包含部署的 symlink 做為 `"link":"target"` 配對。  

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

**user**  <a name="attributes-json-deploy-app-user"></a>
應用程式的使用者 (字串)。  

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