amazon-s3 - 在 AWS Code Pipeline 中实现文件转换的最佳方式
问题描述
我正在为 dotnet 4.7.2 项目实施 CodePipeline,其中代码使用 AWS 的代码部署服务部署在 EC2 实例上。
在管道中,代码从 codeCommit Git 存储库中提取,将代码构建成二进制文件,输出工件以 Zip 格式存储在 S3 存储桶中。
在 web.config 中,我们有 appSettings 键值对,这些键值对因域/客户而异。
如何在将 BuildZip 文件部署到 Ec2 实例之前对其应用转换,以便进行与客户端相关的配置。
{
"pipeline": {
"name": "Module-R13-demo01",
"roleArn": "arn:aws:iam::58:role/service-role/AWSCodePipelineServiceRole-us-east-2-Module-R13",
"artifactStore": {
"type": "S3",
"location": "codepipeline-us-east-2-55"
},
"stages": [
{
"name": "Source",
"actions": [
{
"name": "Source",
"actionTypeId": {
"category": "Source",
"owner": "AWS",
"provider": "CodeCommit",
"version": "1"
},
"runOrder": 1,
"configuration": {
"BranchName": "master",
"OutputArtifactFormat": "CODE_ZIP",
"PollForSourceChanges": "false",
"RepositoryName": "Procurement-Module"
},
"outputArtifacts": [
{
"name": "SourceArtifact"
}
],
"inputArtifacts": [],
"region": "us-east-2",
"namespace": "SourceVariables"
}
]
},
{
"name": "Build",
"actions": [
{
"name": "Build",
"actionTypeId": {
"category": "Build",
"owner": "AWS",
"provider": "CodeBuild",
"version": "1"
},
"runOrder": 1,
"configuration": {
"ProjectName": "Procurement-Module-BuildProject"
},
"outputArtifacts": [
{
"name": "BuildArtifact"
}
],
"inputArtifacts": [
{
"name": "SourceArtifact"
}
],
"region": "us-east-2",
"namespace": "BuildVariables"
}
]
},
{
"name": "Deploy",
"actions": [
{
"name": "Deploy",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"provider": "S3",
"version": "1"
},
"runOrder": 1,
"configuration": {
"BucketName": "demo4cicdbuildonly",
"Extract": "false",
"ObjectKey": "Procurement-Module-R13.zip"
},
"outputArtifacts": [],
"inputArtifacts": [
{
"name": "BuildArtifact"
}
],
"region": "us-east-2",
"namespace": "DeployVariables"
}
]
}
],
"version": 1
}
}
解决方案
推荐阅读
- react-native - FlatList React Native:嵌套对象
- python - 如何每 5 分钟将某人静音 20 秒
- python - 如何编写脚本来读取许多 CSV 文件名和数据并写入另一个 CSV 文件?
- javascript - 类型错误:ss.getSheetByName 不是函数
- angular - 在角度路由 loadchildren 中加载远程 url
- yii2 - Yii2 Kartik Grid 如何从 ExpandRowColumn 导出所有数据,包括部分数据?
- terraform - 创建灵活的 terraform 模块以自定义可选参数时
- simulation - Anylogic中不同级别的PalletRack根据重量排列容器
- python - ortools为什么要严格设置约束?
- flutter - 如何从文件中读取文件以颤动?