本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
目前, CodeCatalyst 仅支持你的开发文件中的exec
命令。有关更多信息,请参阅 Devfile.io 文档中的 Adding commands
以下示例说明如何在 devfile 中指定 exec
命令。
commands:
- id: setupscript
exec:
component: test
commandLine: "chmod +x script.sh"
workingDir: /projects/devfiles
- id: executescript
exec:
component: test
commandLine: "./projects/devfiles/script.sh"
- id: updateyum
exec:
component: test
commandLine: "yum -y update --security"
连接到开发环境后,您可以通过终端执行定义的命令。
/aws/mde/mde command <command-id>
/aws/mde/mde command executescript
对于长时间运行的命令,您可以使用流标志 -s
来实时输出命令的执行。
/aws/mde/mde -s command <command-id>
注意
command-id
必须小写。
支持的 exec 参数 CodeCatalyst
CodeCatalyst 在 devfile 版本 2.0.0 上支持以下exec
参数。
commandLine
component
id
workingDir