Azure静态Web应用程序部署管道错误与NX MonorePo

发布于 2025-02-09 17:19:24 字数 1324 浏览 3 评论 0原文

我正在尝试部署NX MonorePository中的角度应用程序,但我会收到此错误:

检测平台...

无法检测到源目录中的任何平台。

错误:无法从repo中检测到语言。

部署管道看起来像这样:

trigger:
- master
- main
- pipeline

pool:
  vmImage: ubuntu-latest
steps:

- task: NodeTool@0
  inputs:
    versionSpec: '16.x'

- task: CmdLine@2
  displayName: 'Directory listing'
  inputs:
    script: |
      cd $(Agent.BuildDirectory)/apps/luis
      ls -Rla

- script: |
    cd ./apps/luis/
    npm install --location=global @angular/cli
    npm install
    npm run build
  displayName: 'npm install and build'

- task: AzureStaticWebApp@0
  inputs:
      app_location: "apps/luis"
      api_location: ""
      output_location: "dist/apps/luis"
  env:
      azure_static_web_apps_api_token: $(deployment_token)

这是文件夹结构:

“在此处输入图像说明”

编辑: 我通过将应用程序位置更改为应用程序/luis/src来解决第二个错误,从而可以找到index.html文件。但是第一个初始错误仍未解决。

I am trying to deploy an Angular Application that is inside a Nx Monorepository but I get this error:

Detecting platforms...

Could not detect any platform in the source directory.

Error: Could not detect the language from repo.

enter image description here

The deployment pipeline looks like this:

trigger:
- master
- main
- pipeline

pool:
  vmImage: ubuntu-latest
steps:

- task: NodeTool@0
  inputs:
    versionSpec: '16.x'

- task: CmdLine@2
  displayName: 'Directory listing'
  inputs:
    script: |
      cd $(Agent.BuildDirectory)/apps/luis
      ls -Rla

- script: |
    cd ./apps/luis/
    npm install --location=global @angular/cli
    npm install
    npm run build
  displayName: 'npm install and build'

- task: AzureStaticWebApp@0
  inputs:
      app_location: "apps/luis"
      api_location: ""
      output_location: "dist/apps/luis"
  env:
      azure_static_web_apps_api_token: $(deployment_token)

This is the folder structure:

enter image description here

EDIT:
I fixed the second error by changing the app location to apps/luis/src such that it can find the index.html file. But the first initial error is still not solved.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瀞厅☆埖开 2025-02-16 17:19:24

我通过将app_location设置为“/”来修复它。

I fixed it by setting the app_location to "/"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文