简体   繁体   English

是否可以使用 aws amplify 构建和部署 cube.js。 如果是,它的构建设置是什么?

[英]Is it possible to build and deploy cube.js using aws amplify. If yes, what would be build settings for it?

My project includes cube.js backend and react frontend.我的项目包括 cube.js 后端和 react 前端。 I was able to set up CICD using aws amplify for the front end but I am unsure if I can deploy cube.js on aws amplify.我能够为前端使用 aws amplify 设置 CICD,但我不确定是否可以在 aws amplify 上部署 cube.js。

In the local environment I first run 'npm run dev' to run the backend which starts the service on localhost:4000 and I start the react project with 'npm start' and it runs on localhost:3000.在本地环境中,我首先运行“npm run dev”来运行在 localhost:4000 上启动服务的后端,然后使用“npm start”启动反应项目,它在 localhost:3000 上运行。 I would like to build and deploy both backend and frontend using aws amplify我想使用 aws amplify 构建和部署后端和前端

My project is set up similar to this example https://github.com/cube-js/cube.js/tree/master/examples/react-dashboard我的项目设置类似于此示例https://github.com/cube-js/cube.js/tree/master/examples/react-dashboard

In aws amplify, I have the build settings for my frontend as below在 aws amplify 中,我的前端的构建设置如下

version: 0.1
frontend:
  phases:
    preBuild:
      commands:
        - cd dashboard
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: dashboard/build
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

How do I include my backend cube.js project in this?如何在其中包含我的后端 cube.js 项目?

You can use Cube.js Serverless template to deploy backend as a set of lambdas: https://cube.dev/docs/deployment#serverless .您可以使用 Cube.js 无服务器模板将后端部署为一组 lambda: https://cube.dev/docs/deployment#serverless This way you can include serverless deploy -v command as part of your Amplify build cycle like:这样,您可以将serverless deploy -v命令作为 Amplify 构建周期的一部分,例如:

backend:
  phases:
    preBuild:
      commands:
        - serverless deploy -v

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 AWS amplify 上部署 Next Js SSR 应用程序。 (网站内部错误和部署在 cli 上失败) - Unable to Deploy Next Js SSR app on AWS amplify. ( Internal error on Website and Deployment failed on cli) AWS Amplify Deploy(构建和测试)React JS + Jest + Enzyme - AWS Amplify Deploy (Build & Test) React JS + Jest + Enzyme AWS Amplify React App Deploy 错误 - 重定向或 AWS 构建设置过多 - AWS Amplify React App Deploy Error- Too many redirect or AWS Build Settings 使用 Cube.js 持久化数据 - Persist data using Cube.js AWS Amplify 构建失败 - AWS Amplify build fails 如何为cube.js 动态生成架构? - How to dynamically generate schema for cube.js? 在 AWS Amplify 上构建 React 应用程序在 Amplify 控制台中失败 - Build of React application on AWS Amplify fails in Amplify Console AWS 在 geo/lib-esm/util.js 处放大全栈演示构建错误: - AWS amplify full stack demo build error at geo/lib-esm/util.js: 尝试在 aws amplify 上部署 react 应用程序,但不断收到“未为工件指定的基本目录,无法创建构建工件”。 - Trying to deploy react app on aws amplify but keep getting a "Base Directory not specified for artifacts, unable to create build artifact." 使用带有构建变量的 AWS Code Pipeline 部署 React App - Deploy React App using AWS Code Pipeline with build variables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM