

Amazon CodeCatalyst 不再向新客戶開放。現有客戶可以繼續正常使用該服務。如需詳細資訊，請參閱[如何從 CodeCatalyst 遷移](migration.md)。

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

# Devfile 事件
<a name="devenvironment-devfile-events"></a>

目前，CodeCatalyst 僅支援您 devfile 中的`postStart`事件。如需詳細資訊，請參閱 https：//Devfile.io 文件中的 [postStartObject](https://devfile.io/docs/2.0.0/adding-event-bindings#post-start-object)。

下列範例示範如何在 devfile 中新增`postStart`事件繫結。

```
commands:
  - id: executescript
    exec:
      component: test
      commandLine: "./projects/devfiles/script.sh"
  - id: updateyum
    exec:
      component: test
      commandLine: "yum -y update --security"
events:
  postStart:
    - updateyum
    - executescript
```

啟動後，開發環境會依定義的順序執行指定的`postStart`命令。如果命令失敗，開發環境將繼續執行，且執行輸出會存放在 下的日誌中`/aws/mde/logs`。