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

View File

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