2
votes

.yml file:

image: microsoft/dotnet:sdk

pipelines:
  default:
    - step:
        caches:
          - dotnetcore
        script: # Modify the comma`nds below to build your repository.
          - export SOLUTION_NAME=SSU.IS.Services
          - export PROJECT_NAME=SSU.IS.Identity
          - export TEST_NAME=SSU.IS.Module.StaffRecords.Test
          - dotnet restore $SOLUTION_NAME
          - dotnet build $PROJECT_NAME
          - dotnet test #$TEST_NAME

The bitbucket-pipeline.yml is in the root directory, there is a folder named SSU.IS.Services which contains the .sln as well as other folders which contain further folders containing projects.

The restore has no issues, however the build step errors out.

I have attempted leaving it blank, specifying the project name, giving what I believe to be the relative path to the project - all to no avail.

Path to the .csproj

identity-management-mvc/SSU.IS.Services/Sites/Identity/SSU.IS.Identity/SSU.IS.Identity.csproj

enter image description here

2

2 Answers

2
votes

For those reading typing the full path including file extension has worked:

image: microsoft/dotnet:sdk

pipelines:
  default:
    - step:
        caches:
          - dotnetcore
        script: # Modify the comma`nds below to build your repository.
          - export SOLUTION_NAME=SSU.IS.Services
          - export PROJECT_NAME=SSU.IS.Services/Sites/Identity/SSU.IS.Identity/SSU.IS.Identity.csproj
          - export TEST_NAME=SSU.IS.Services/Tests/SSU.IS.Module.StaffRecords.Test/SSU.IS.Module.StaffRecords.Test.csproj
          - dotnet restore $SOLUTION_NAME
          - dotnet build $PROJECT_NAME
          - dotnet test $TEST_NAME
0
votes
/opt/atlassian/pipelines/agent/build/"ProjectSolutionName"/"ProjectName".csproj

ONLY THIS helped me. Enjoy =)