AWS codeBuild:将多个输入源合并为一个输出工件

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

我将有角度的客户端和Node.js服务器部署到一个elasticBeanstalk中。结构是我将有角度的客户端文件放在“ html”文件夹中,并且代理在.ebextensions文件夹中定义。

-html
-other serverapp folder
-other serverapp folder
-.ebextensions
....
-package.json
-server.js

[每次发布时,我都会构建有角度的应用程序,并将其放入节点应用程序的html文件夹中,将其压缩并上传到elasticBeanstalk。

现在,我想继续进入CICD。基本上,我想自动化以上步骤,使用两个源(Angular和Node App),进行Angular构建并将其放入Node App的html文件夹中,仅生成一个输出工件。

我已经到达了每个应用程序都有单独管道的阶段。我对AWS还不是很熟悉,只是模糊的想法,可能需要使用AWS Lambda。

任何帮助将不胜感激。

amazon-web-services continuous-integration aws-code-deploy aws-codepipeline aws-codebuild
1个回答
0
投票

您的CodeBuild作业创建的输出工件可以认为是您要求CodeBuild压缩为工件的目录位置。您可以在打包工件之前使用常规的UNIX命令来操作此目录。以下是“ buildspec.yml”的示例:

version: 0.2


phases:
  build:
    commands:
      # build commands
      #- command
  post_build:
    commands:
      - mkdir /tmp/html
      - cp -R ./ /tmp/html

artifacts:
  files:
    - '**/*'
  base-directory: /tmp/html

Buildspec参考:https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax

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