vftw
vftw

Reputation: 1687

Not found scriptPath in azure devops

I put a shell script file in a folder on my repo root and tried to run that in my devops pipeline but it says that cannot find the scriptPath:

[error]Not found scriptPath: /home/vsts/work/1/s/pipelines/databricks-cli-config.sh

I am simply creating a task to run the shell script, like this:

- task: ShellScript@2
  inputs:
    scriptPath: 'pipelines/databricks-cli-config.sh'
    args: '$(databricks_host) $(databricks_token)'
  displayName: "Install and configure the Databricks CLI"

Any idea?

enter image description here

Upvotes: 0

Views: 2306

Answers (1)

Krzysztof Madej
Krzysztof Madej

Reputation: 40749

Make sure you checkout your code and you are on correct level. So if you are on regular job please add working directory:

- task: ShellScript@2
  inputs:
    scriptPath: 'pipelines/databricks-cli-config.sh'
    args: '$(databricks_host) $(databricks_token)'
    cwd: '$(System.DefaultWorkingDirectory)'
  displayName: "Install and configure the Databricks CLI"

and if you use it on deployment job, by default code is not being checked out there. So you need you need to publish this script as artifact and then download it in deployment job (deployment jobs download artifact by default) or add

- checkout: self

step do download code on deployment job.

I assumed that you use YAML.

Upvotes: 1

Related Questions