1
0
mirror of https://github.com/ebosas/microservices.git synced 2025-08-24 20:08:55 +02:00

Create pipeline with separate builds

This commit is contained in:
ebosas
2021-11-11 13:28:34 +02:00
parent bf3c8584e8
commit 597284d478
2 changed files with 96 additions and 94 deletions

View File

@@ -173,72 +173,74 @@ Resources:
# InputArtifacts:
# - Name: Source
# #-----------------------------------------------------------------------------#
# # Services
# #-----------------------------------------------------------------------------#
# - Name: Services
# Actions:
#-----------------------------------------------------------------------------#
# Services
#-----------------------------------------------------------------------------#
- Name: Services
Actions:
# - Name: Server
# ActionTypeId:
# Category: Deploy
# Owner: AWS
# Version: 1
# Provider: CloudFormation
# Configuration:
# ActionMode: CREATE_UPDATE
# RoleArn: !GetAtt CloudFormationDeployRole.Arn
# StackName: !Sub ${EnvironmentName}-Server
# TemplatePath: !Sub Source::deployments/services-${DeploymentType}/server.yml
# Capabilities: CAPABILITY_IAM
# ParameterOverrides: !Sub |
# {
# "EnvironmentName": "${EnvironmentName}",
# "ServiceName": "server",
# "ImageUrl": "don't have it yet"
# }
# InputArtifacts:
# - Name: Source
- Name: Server
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: CloudFormation
Configuration:
ActionMode: CREATE_UPDATE
RoleArn: !GetAtt CloudFormationDeployRole.Arn
StackName: !Sub ${EnvironmentName}-Server
TemplatePath: !Sub Source::deployments/services-${DeploymentType}/server.yml
Capabilities: CAPABILITY_IAM
ParameterOverrides: !Sub |
{
"EnvironmentName": "${EnvironmentName}",
"ServiceName": "server",
"ImageUrl": "amazon/amazon-ecs-sample"
}
InputArtifacts:
- Name: Source
# - Name: Cache
# ActionTypeId:
# Category: Deploy
# Owner: AWS
# Version: 1
# Provider: CloudFormation
# Configuration:
# ActionMode: CREATE_UPDATE
# RoleArn: !GetAtt CloudFormationDeployRole.Arn
# StackName: !Sub ${EnvironmentName}-Cache
# TemplatePath: !Sub Source::deployments/services-${DeploymentType}/cache.yml
# Capabilities: CAPABILITY_IAM
# ParameterOverrides: !Sub |
# {
# "EnvironmentName": "${EnvironmentName}",
# "ServiceName": "cache"
# }
# InputArtifacts:
# - Name: Source
- Name: Cache
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: CloudFormation
Configuration:
ActionMode: CREATE_UPDATE
RoleArn: !GetAtt CloudFormationDeployRole.Arn
StackName: !Sub ${EnvironmentName}-Cache
TemplatePath: !Sub Source::deployments/services-${DeploymentType}/cache.yml
Capabilities: CAPABILITY_IAM
ParameterOverrides: !Sub |
{
"EnvironmentName": "${EnvironmentName}",
"ServiceName": "cache",
"ImageUrl": "amazon/amazon-ecs-sample"
}
InputArtifacts:
- Name: Source
# - Name: Database
# ActionTypeId:
# Category: Deploy
# Owner: AWS
# Version: 1
# Provider: CloudFormation
# Configuration:
# ActionMode: CREATE_UPDATE
# RoleArn: !GetAtt CloudFormationDeployRole.Arn
# StackName: !Sub ${EnvironmentName}-Database
# TemplatePath: !Sub Source::deployments/services-${DeploymentType}/database.yml
# Capabilities: CAPABILITY_IAM
# ParameterOverrides: !Sub |
# {
# "EnvironmentName": "${EnvironmentName}",
# "ServiceName": "database"
# }
# InputArtifacts:
# - Name: Source
- Name: Database
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: CloudFormation
Configuration:
ActionMode: CREATE_UPDATE
RoleArn: !GetAtt CloudFormationDeployRole.Arn
StackName: !Sub ${EnvironmentName}-Database
TemplatePath: !Sub Source::deployments/services-${DeploymentType}/database.yml
Capabilities: CAPABILITY_IAM
ParameterOverrides: !Sub |
{
"EnvironmentName": "${EnvironmentName}",
"ServiceName": "database",
"ImageUrl": "amazon/amazon-ecs-sample"
}
InputArtifacts:
- Name: Source
#-----------------------------------------------------------------------------#

View File

@@ -29,9 +29,9 @@ Parameters:
CodePipelineServiceRoleArn:
Type: AWS::SSM::Parameter::Value<String>
Default: /microservices/codepipeline_service_role_arn
CloudFormationDeployRole:
Type: AWS::SSM::Parameter::Value<String>
Default: /microservices/cloudformation_deploy_role
# CloudFormationDeployRole:
# Type: AWS::SSM::Parameter::Value<String>
# Default: /microservices/cloudformation_deploy_role
Resources:
@@ -181,22 +181,6 @@ Resources:
#-----------------------------------------------------------------------------#
# Deploy
#-----------------------------------------------------------------------------#
# - Name: Deploy
# Actions:
# - Name: Deploy
# ActionTypeId:
# Category: Deploy
# Owner: AWS
# Version: 1
# Provider: ECS
# Configuration:
# ClusterName:
# Fn::ImportValue: !Sub ${EnvironmentName}:ClusterName
# ServiceName: !Ref ServiceName
# FileName: imageDetail.json
# InputArtifacts:
# - Name: Image
- Name: Deploy
Actions:
- Name: Deploy
@@ -204,21 +188,37 @@ Resources:
Category: Deploy
Owner: AWS
Version: 1
Provider: CloudFormation
Provider: ECS
Configuration:
ActionMode: CREATE_UPDATE
RoleArn: !Ref CloudFormationDeployRole
StackName: !Sub ${EnvironmentName}-ServerService
TemplatePath: !Sub Code::deployments/services-${DeploymentType}/server.yml
Capabilities: CAPABILITY_IAM
ParameterOverrides: !Sub |
{
"EnvironmentName": "${EnvironmentName}",
"ImageUrl": "${Repository.RepositoryUri}@#{ImageVariables.ImageDigest}"
}
ClusterName:
Fn::ImportValue: !Sub ${EnvironmentName}:ClusterName
ServiceName: !Ref ServiceName
FileName: imageDetail.json
InputArtifacts:
- Name: Image
- Name: Code
# - Name: Deploy
# Actions:
# - Name: Deploy
# ActionTypeId:
# Category: Deploy
# Owner: AWS
# Version: 1
# Provider: CloudFormation
# Configuration:
# ActionMode: CREATE_UPDATE
# RoleArn: !Ref CloudFormationDeployRole
# StackName: !Sub ${EnvironmentName}-ServerService
# TemplatePath: !Sub Code::deployments/services-${DeploymentType}/server.yml
# Capabilities: CAPABILITY_IAM
# ParameterOverrides: !Sub |
# {
# "EnvironmentName": "${EnvironmentName}",
# "ImageUrl": "${Repository.RepositoryUri}@#{ImageVariables.ImageDigest}"
# }
# InputArtifacts:
# - Name: Image
# - Name: Code
#-----------------------------------------------------------------------------#
# Role for CodeBuild service