You need to enable JavaScript to run this app.
文档中心
持续交付

持续交付

复制全文
下载 pdf
步骤列表
命令执行
复制全文
下载 pdf
命令执行
命令执行步骤用于在流水线中运行自定义的 Shell 脚本或在指定的容器环境中执行命令,满足灵活的自动化需求。​
Shell 命令执行​
在标准的 Bash 环境中执行用户提供的 Shell 命令。​
  • 组件:exec@1.0.0​
  • 参数:​
  • ​
    参数​
    数据类型​
    是否必填​
    默认值​
    说明​
    cmd​
    string​
    是​
    -​
    要执行的命令脚本(多行 Shell)。​
    shell​
    string​
    是​
    BASH​
    Shell 类型,固定为 BASH。​
    ​
  • 示例:​
  • ​
    tasks:​
    - task: task-exec-shell​
    displayName: Execute Shell Command​
    steps:​
    - step: step-exec-shell​
    component: exec@1.0.0​
    inputs:​
    cmd: |​
    echo "Starting custom script..."​
    ls -la​
    echo "Script finished."​
    shell: BASH​
    ​
自定义环境命令执行​
拉取用户指定的 Docker 镜像,并在该镜像所提供的环境中执行命令。适用于需要特定工具或依赖的场景。​
  • 组件:custom-image@2.0.0​
  • 参数:​
  • ​
    参数​
    数据类型​
    是否必填​
    默认值​
    说明​
    image​
    string​
    是​
    -​
    用于执行命令的 Docker 镜像,如 ubuntu:20.04。​
    cmd​
    string​
    是​
    -​
    要在容器中执行的命令(多行 Shell)。​
    loginCredential​
    list​
    否​
    -​
    访问私有镜像仓库的凭据,使用服务连接。​
    ​
  • 示例​
  • ​
    tasks:​
    - task: task-custom-public​
    displayName: Custom Image Command (Public)​
    steps:​
    - step: step-custom-public​
    component: custom-image@2.0.0​
    inputs:​
    image: 'node:18-alpine'​
    cmd: |​
    echo "Node.js version:"​
    node -v​
    ​
  • ​
最近更新时间:2026.05.11 11:33:37
这个页面对您有帮助吗?
有用
有用
无用
无用