在 Azure Devops 的 mono repo 中設置項目的工作目錄 (Set working directory of a project in mono repo in Azure Devops)


問題描述

在 Azure Devops 的 mono repo 中設置項目的工作目錄 (Set working directory of a project in mono repo in Azure Devops)

我的項目正在使用微服務,在一個存儲庫中,我們在 Azure DevOps 中有多個應用程序。例如,我們有名為 Microservice 的 Repos,其中有 .NetProject、AngularUI 項目和 Java 項目代碼。結構如下所示:

在此處輸入圖片描述

在設置 CI 管道時,我已包含如下路徑:

variables:
  ‑ name: working‑dir
    value: 'MicroserviceProject/AngularUI/ClientApp/'

trigger:
  branches:
    include:
      ‑ master
  paths:
    include:
      ‑ 'MicroserviceProject/AngularUI/ClientApp/*'

我沒有看到 AngularUI 項目的代碼被正確檢出並遇到錯誤,他們無法找到 package.json 文件。如何在 repo 中為不同項目設置工作目錄?

更新:

我能夠找到文件,但構建沒有給我任何輸出文件。在此處輸入圖片描述

我能夠找到該文件,但構建沒有給我任何輸出文件。在此處輸入圖片描述

我能夠找到該文件,但構建沒有給我任何輸出文件。在此處輸入圖片描述


參考解法

方法 1:

How I fixed this issue: Initially I was not sure if the working directory was set properly.Even if it was , I was not sure whether the package.json file was read properly. To check that, I added the below script to the Azure CI pipeline, for example:

  inputs:
targetType: 'inline'
script: dir
  $(Build.ArtifactStagingDirectory)

displayName: 'Check'

This showed me that after building , the artifacts are not stored anywhere. hence I had to explicitly mention the outputpath. For that I ran the below command for build:

run‑script build ‑‑ ‑‑output‑path=$(Build.ArtifactStagingDirectory

This fixed the issue I was facing.

(by AsterixAsterix)

參考文件

  1. Set working directory of a project in mono repo in Azure Devops (CC BY‑SA 2.5/3.0/4.0)

#azure-devops #yaml #monorepo






相關問題

Visual Studio Online Build - Visual Studio SDK 和 Modellng SDK (Visual Studio Online Build - Visual Studio SDK and Modellng SDK)

有沒有辦法將現有的“功能”分配給史詩? (Is there a way to assign existing "feature" to epic?)

在路徑 Visual Studio Team Services 中找不到 curl (curl was not found in the path Visual Studio Team Services)

遠程 TFS 2015 到 Azure Devops(私有云)遷移 (Remote TFS 2015 to Azure Devops (private cloud) Migration)

無法再推送到 myProject.visualstudio.com (Can't push to myProject.visualstudio.com anymore)

使用 Visual Studio Code 連接 AzureDevOps Git 存儲庫時出現問題 (Issue in connecting AzureDevOps Git repo using Visual Studio Code)

適用於 Azure DevOps 和本地 PC 的發布生成事件 (Post Build event that works on both Azure DevOps and Local PC)

使用 Azure Devops 進行 CI/CD 部署 (CI/CD Deployment Using Azure Devops)

取回我創建的 DevOps 組織的所有權 (Get back ownership of DevOps organization that was created by me)

在使用源代碼管理時,我如何才能對源代碼的不同部分的用戶組擁有不同的權限? (While using source control, how can I have different permissions for groups of users for different parts of the source code?)

在 Azure DevOps 中自動更改用戶的訪問級別 (Automatically change access level on a user in Azure DevOps)

Azure DevOps Powershell 獲取與構建管道相關的工作項 (Azure DevOps Powershell get work item related to build pipeline)







留言討論