UiPath-Services / UiPath-DevOps-Scripts

26 stars 23 forks source link

Issue with running CLI with Gitlab CI #6

Closed cormacrw closed 1 year ago

cormacrw commented 1 year ago

I am trying to run the UIPath CLI in the gitlab cli, here is what is in my yml.

  before_script:
    - New-Item -Path ".\\" -ItemType "directory" -Name "scripts"
    - Invoke-WebRequest "https://github.com/UiPath-Services/UiPath-DevOps-Scripts/raw/main/scripts/UiPathRunTest.ps1" -OutFile ".\scripts\UiPathRunTest.ps1"
  script:
    - .\scripts\UiPathRunTest.ps1 -orchestrator_url "https://cloud.uipath.com" -orchestrator_tenant ${UIPATH_TENANT_NAME} -applicationId ${UIPATH_APPLICATION_ID} -applicationSecret ${UIPATH_APPLICATION_SECRET} -accountForApp ${UIPATH_ACCOUNT_NAME} -project_path ".\test\project.json" -environment ${UIPATH_FOLDER} -out junit -applicationScope "OR.Monitoring OR.Folders OR.BackgroundTasks OR.TestSets OR.TestSetExecutions OR.TestSetSchedules OR.Settings OR.Robots OR.Machines OR.Execution OR.Assets OR.Users OR.Jobs"
  artifacts:
    when: always
    paths:
      - ./junitresult.xml
    reports:
      junit: ./junitresult.xml
  tags:
    - windows

however I get the following error, image

I have tried to install dotnet seperately but it still doesn't seem to work, the readme of this repo suggests that the scripts will download all dependencies, and in the gitlab ci example provided there is no where dotnet is installed.

What am I doing wrong?

Thanks in advance.

SE-Abdullah commented 1 year ago

Hi @cormacrw the latest version of the official UiPath CLI does require .NET 6.0.7, that must include .NET 6.0.7 Desktop Runtime, that come with the 6.0.302 SDK. Make sure you have all three installed in your GitLab runner machine. Use the below command to verify of the .NET prerequisites are installed

dotnet --list-runtimes 
dotnet --list-sdks 

Old version of CLI did not require additional dependencies to be installed separately. When we says 'script will download all dependencies' we mean the scripts will download the UiPath CLI automatically. I will update README file for more clarification.

We are working on separate PowerShell script to verify the CLI prerequisites and install if does not exist based on Available Microsoft Script Reference