我无法通过 bitbucket 将 React Native Web 应用程序部署到 Azure 静态 Web 应用程序

问题描述 投票:0回答:1

这是我的管道

bitbucket-pipelines.yml

image: atlassian/default-image:latest

options:
  docker: true
  size: 2x

pipelines:
  branches:
    dev:
      - step:
          name: Deploy to test
          deployment: test
          caches:
            - node
          script:
            - pipe: microsoft/azure-static-web-apps-deploy:main
              variables:
                APP_LOCATION: "$BITBUCKET_CLONE_DIR/"
                OUTPUT_LOCATION: "$BITBUCKET_CLONE_DIR/web-build"
                API_TOKEN: $deployment_token
                APP_BUILD_COMMAND: npx expo export:web

definitions:
  services:
    docker:
      memory: 4096

The error message was: EACCES: permission denied, mkdir '/root/.config/devcert' - Click to preview the error

我尝试先创建工件,然后通过

microsoft/azure-static-web-apps-deploy:main
管道进行部署,但它也不起作用。

image: node:16-alpine

options:
  docker: true
  size: 2x

pipelines:
  branches:
    dev:
      - step:
          name: Build and Test
          caches:
            - node
          script:
            - npm install yarn
            - yarn
            - npx expo export:web
          artifacts:
            - web-build/**
      - step:
          name: Deploy to test
          deployment: test
          script:
            - pipe: microsoft/azure-static-web-apps-deploy:main
              variables:
                APP_LOCATION: "$BITBUCKET_CLONE_DIR/"
                OUTPUT_LOCATION: "$BITBUCKET_CLONE_DIR/web-build"
                API_TOKEN: $deployment_token
                SKIP_APP_BUILD: "true"

definitions:
  services:
    docker:
      memory: 4096

The error message was: Failed to find a default file in the app artifacts folder (opt/atlassian/pipelines/agent/build/). Valid default files: index.html,Index.html. - Click to preview the error

azure bitbucket-pipelines azure-static-web-app
1个回答
0
投票

我建议采取以下步骤:

Azure 帐户设置: Azure 静态 Web 应用资源: 存储库配置: Azure 静态 Web 应用配置: 构建配置: GitHub Actions 或 Azure Pipelines: CI/CD 配置: 秘密和环境变量: 触发部署: 监控部署: 调试: 迭代和完善:

由于您使用的是 Bitbucket 而不是 GitHub,因此由于 CI/CD 系统的差异,某些步骤可能会略有不同。请务必查阅有关 Bitbucket 集成的 Azure 静态 Web 应用文档,并浏览 Azure Pipelines 文档以设置 Bitbucket 存储库的 CI/CD。

© www.soinside.com 2019 - 2024. All rights reserved.