2017-08-01 5 views
2

Bitbucketパイプラインでビルドを構成するのが苦労しています。Bitbucketパイプラインでサブフォルダを構築する方法

これはC#ソリューションで、コードはリポジトリのルートフォルダではなくサブフォルダにあります。私は、ドキュメントを読んだ

+ dotnet restore

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

が、サブフォルダを指定しようとするオプションがないように思える:私はそれを構築するとき、私はエラーを取得する理由はここにあります。あなたはそれをどのように設定しますか?実験でそれを見つけた

image: microsoft/dotnet:latest 

pipelines: 
    default: 
    - step: 
     caches: 
      - dotnetcore 
     script: # Modify the commands below to build your repository. 
      - export PROJECT_NAME=MyProjectNameHere 
      - export TEST_NAME=MyProjectNameHere 
      - dotnet restore 
      - dotnet build $PROJECT_NAME 
      - dotnet test $TEST_NAME 

答えて

2

は、ドキュメントは全くそれを言及しませんでした:

は、ここに私の.ymlファイルです。

あなたが2行にフルパスとソリューションのファイル名を使用する必要があるとだけrestoreライン上のフォルダ名:

image: microsoft/dotnet:latest 

pipelines: 
    default: 
    - step: 
     caches: 
      - dotnetcore 
     script: # Modify the commands below to build your repository. 
      - export PROJECT_NAME=FolderNameHere/MySolution.sln # use the full path and solution file name 
      - export TEST_NAME=FolderNameHere/MySolution.sln # use the full path and solution file name 
      - dotnet restore FolderNameHere # use only folder name here 
      - dotnet build $PROJECT_NAME 
      - dotnet test $TEST_NAME 
+0

が私のために働きました!ありがとう –

関連する問題