Amazon web services Codepipeline:仅将特定文件部署到s3
我在AWS Codepipeline方面遇到了问题,我希望Codepipeline只部署一个文件,而不是将整个GitHub repo部署到S3存储桶 编辑: 我使用的是AWS代码构建,我的部署yaml文件如下Amazon web services Codepipeline:仅将特定文件部署到s3,amazon-web-services,aws-codepipeline,Amazon Web Services,Aws Codepipeline,我在AWS Codepipeline方面遇到了问题,我希望Codepipeline只部署一个文件,而不是将整个GitHub repo部署到S3存储桶 编辑: 我使用的是AWS代码构建,我的部署yaml文件如下 version: 0.2 phases: install: runtime-versions: nodejs: 8 commands: - npm i npm@latest -g - pip install --upgrade pi
version: 0.2
phases:
install:
runtime-versions:
nodejs: 8
commands:
- npm i npm@latest -g
- pip install --upgrade pip
- pip install --upgrade awscli
pre_build:
commands:
- npm install redoc-cli -g
build:
commands:
- redoc-cli bundle ./orchestra/api/api.yml
artifacts:
files:
- redoc-static.html
你就快到了。您已经在从CodeBuild项目(buildspec的工件部分)导出需要部署到S3的“一个”文件(redoc static.html)。现在,在您的代码管道中,在代码构建阶段,为操作命名一个新的“输出工件”,然后确保在部署阶段(部署到S3)使用构建阶段的这个输出工件,它将只包括一个文件(构建工件)从代码构建阶段开始。这将是一个完整的代码管道片段,用于在代码信息中部署作为
工件:/files:
列出的内容到传递到名为S3Bucket的模板参数中的现有S3Bucket中。或者,这里的“源”阶段是从链接的GitHub回购中提取。请注意,ArtifactBucket是一个不同的“短暂的”,代码管道在这个过程中使用它作为中介
Pipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
RoleArn: !GetAtt CodePipelineServiceRole.Arn
ArtifactStore:
Type: S3
Location: !Ref ArtifactBucket
Stages:
- Name: Source
Actions:
- Name: App
ActionTypeId:
Category: Source
Owner: ThirdParty
Version: 1
Provider: GitHub
Configuration:
Owner: !Ref GitHubRepoOwner
Repo: !Ref GitHubRepo
Branch: !Ref GitHubBranch
OAuthToken: !Ref GitHubToken
OutputArtifacts:
- Name: App
RunOrder: 1
- Name: Build
Actions:
- Name: Build
ActionTypeId:
Category: Build
Owner: AWS
Version: 1
Provider: CodeBuild
Configuration:
ProjectName: !Ref CodeBuildProject
InputArtifacts:
- Name: App
OutputArtifacts:
- Name: BuildOutput
RunOrder: 1
- Name: Deploy
Actions:
- Name: Deploy
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: S3
Configuration:
BucketName: !Ref S3Bucket
Extract: true
InputArtifacts:
- Name: BuildOutput
RunOrder: 1
CodePipeline是编排,您在构建和/或部署时使用什么服务?