在 Azure YAML 管道的脚本阶段添加多个命令

Adding multiple commands under scripts stage in Azure YAML pipeline

我需要在项目仓库中执行以下命令来构建

 echo Building Software/linux_framework
 source /opt/pkg/linux/settings.sh
 cd Software/linux_framework
 make images HARDWARE=../my_xsa/ BOARD=local

我的 YAML 文件中的片段:

pool:
  name: Default

steps:
- script: echo Building Software/linux_framework
          source /opt/pkg/linux/settings.sh
          cd Software/linux_framework 
          make images HARDWARE=../my_xsa/ BOARD=local   
  displayName: 'Make Project'

当我 运行 构建时,所有 4 个命令都在终端上回显。如何在同一终端会话中将它们作为单独的命令执行

尝试这样的事情:

- script: |
    echo Building Software/linux_framework
    source /opt/pkg/linux/settings.sh
    cd Software/linux_framework
    make images HARDWARE=../my_xsa/ BOARD=local
  displayName: 'Make Project'

注意单行脚本和多行脚本的区别:

- script: echo Hello, world!
  displayName: 'Run a one-line script'

- script: |
    echo Hello, world!
    echo Hello, world!
  displayName: 'Run a multi-line script'