4

I need to execute following commands in the project repo to a do a build

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

Snippet from my YAML file:

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'

When I run the build all 4 commands are just echoed on the terminal. How to execute them as separate commands in the same terminal session

h1990
  • 125
  • 3
  • 11

1 Answers1

12

Try something like this:

- 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'

Pay attention to the difference between one-line script and multi-line script:

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

- script: |
    echo Hello, world!
    echo Hello, world!
  displayName: 'Run a multi-line script'
LoLance
  • 25,666
  • 1
  • 39
  • 73