0

I have a python script on my Azure Repository. It is called build.py and it's inside folder swagger_updater. I am able to use it in a Build Pipeline easily, with the following script:

steps:
  - task: PythonScript@0
    inputs:
      scriptSource: filePath
      scriptPath: swagger_updater/build.py
      pythonInterpreter: /usr/bin/python3

Now, I want to run in the Release Pipeline, my release.py script which is in the same swagger_updater folder. What should I write in the Script Path? If I write swagger_updater/release.py it does not work. Please, see this image

Edoardo
  • 13
  • 5
  • Please check if the update work for you. – Ging Yuan-MSFT Nov 29 '22 at 02:53
  • Yes it works thank you. But I already knew this soultion. I was looking for the Release to access the Repository without having to pass the scripts as artifacts. – Edoardo Nov 30 '22 at 10:45
  • Currently, there is no option to achieve this. It should use artifacts as the resource code. You can try to use the REST API to get the file: https://stackoverflow.com/questions/62464734/get-file-from-azure-devops-repository-using-rest-api – Ging Yuan-MSFT Dec 05 '22 at 06:47

1 Answers1

0

Since the release pipeline will download the artifact from the build pipeline. You could use the "Publish pipeline artifact" in your build pipeline. And then use the artifact in your release pipeline.

In build pipeline:

build

In release pipeline:

release

Update: If you are using Azure Repo directly, please check the following steps:

aure repo use python

Ging Yuan-MSFT
  • 689
  • 2
  • 6
  • Thank you Ging. So the only way for the Release to use a script is to get it as an artifact from the Build? Can't the Release access the Repository directly (as the Build does)? – Edoardo Nov 27 '22 at 08:07
  • @Edoardo I have updated the steps, please have a look. – Ging Yuan-MSFT Nov 28 '22 at 01:53