mirror of
				https://github.com/yeslayla/nakama-helm-chart.git
				synced 2025-10-31 10:33:03 +01:00 
			
		
		
		
	Merge pull request #2 from josephbmanley/feature/cluster
Integrated cluster into stack
This commit is contained in:
		
							
								
								
									
										6
									
								
								.github/workflows/push_develop.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.github/workflows/push_develop.yml
									
									
									
									
										vendored
									
									
								
							| @ -4,14 +4,16 @@ name: Push Develop Release | |||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches-ignore: |     branches-ignore: | ||||||
|       - develop |       - master | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|     - name: Checkout Repo |     - name: Checkout Repo | ||||||
|       uses: actions/checkout@v1 |       uses: actions/checkout@v2.1.0 | ||||||
|  |       with: | ||||||
|  |         submodules: 'true' | ||||||
|     - name: Ship to S3 |     - name: Ship to S3 | ||||||
|       uses: jakejarvis/s3-sync-action@master |       uses: jakejarvis/s3-sync-action@master | ||||||
|       with: |       with: | ||||||
|  | |||||||
							
								
								
									
										13
									
								
								.github/workflows/push_production.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								.github/workflows/push_production.yml
									
									
									
									
										vendored
									
									
								
							| @ -4,14 +4,16 @@ name: Push Production Release | |||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches: |     branches: | ||||||
|       - develop |       - master | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|     - name: Checkout Repo |     - name: Checkout Repo | ||||||
|       uses: actions/checkout@v1 |       uses: actions/checkout@v2.1.0 | ||||||
|  |       with: | ||||||
|  |         submodules: 'true' | ||||||
|     - name: Ship to S3 |     - name: Ship to S3 | ||||||
|       uses: jakejarvis/s3-sync-action@master |       uses: jakejarvis/s3-sync-action@master | ||||||
|       with: |       with: | ||||||
| @ -23,3 +25,10 @@ jobs: | |||||||
|         AWS_S3_BUCKET: sumu-stacks |         AWS_S3_BUCKET: sumu-stacks | ||||||
|         AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |         AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||||||
|         AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |         AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||||||
|  |     - name: Deploy to AWS CloudFormation | ||||||
|  |       uses: aws-actions/aws-cloudformation-github-deploy@v1 | ||||||
|  |       with: | ||||||
|  |         name: ecs-nakama-stack | ||||||
|  |         template: top.yaml | ||||||
|  |         capabilities: "CAPABILITY_NAMED_IAM,CAPABILITY_IAM" | ||||||
|  |         parameter-overrides: VpcId=${{ secrets.VPC_ID }},Domain=${{ secrets.DOMAIN }},SubDomain=nakama,PortalCertificate=${{ secrets.CERTIFICATE_ARN }},PublicSubnets=${{ secrets.SUBNET_IDS }} | ||||||
							
								
								
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | |||||||
|  | [submodule "cloudformation/cluster"] | ||||||
|  | 	path = cloudformation/cluster | ||||||
|  | 	url = git@github.com:josephbmanley/aws-cluster-stack.git | ||||||
							
								
								
									
										1
									
								
								cloudformation/cluster
									
									
									
									
									
										Submodule
									
								
							
							
								
								
								
								
								
							
						
						
									
										1
									
								
								cloudformation/cluster
									
									
									
									
									
										Submodule
									
								
							 Submodule cloudformation/cluster added at a7d7961c27
									
								
							| @ -21,15 +21,16 @@ Parameters: | |||||||
|   #------------------- |   #------------------- | ||||||
|   # ECS Configuration |   # ECS Configuration | ||||||
|   #------------------- |   #------------------- | ||||||
|   EcsCluster: |   EcsClusterOverride: | ||||||
|     Type: String |     Type: String | ||||||
|     Description: The cluster to run the Nakama service on. |     Description: The cluster to run the Nakama service on, if empty will create new cluster | ||||||
|  |     Default: "" | ||||||
|    |    | ||||||
|   #----------------- |   #----------------- | ||||||
|   # Load Balancing  |   # Load Balancing  | ||||||
|   #----------------- |   #----------------- | ||||||
|   PublicSubnets: |   PublicSubnets: | ||||||
|     Description: The public subnets for the ALB to run in. |     Description: The public subnets for the ALB to run in. (Seperate by spaces) | ||||||
|     Type: String |     Type: String | ||||||
|   PortalCertificate: |   PortalCertificate: | ||||||
|     Description: Arn of AWS Certificate |     Description: Arn of AWS Certificate | ||||||
| @ -111,6 +112,7 @@ Parameters: | |||||||
| Conditions: | Conditions: | ||||||
|   CreateRdsStack: !Equals [!Ref CreateDatabase, "true"] |   CreateRdsStack: !Equals [!Ref CreateDatabase, "true"] | ||||||
|   CreateDns: !Not [!Equals [!Ref Domain, ""]] |   CreateDns: !Not [!Equals [!Ref Domain, ""]] | ||||||
|  |   CreateCluster: !Equals [!Ref EcsClusterOverride, ""] | ||||||
|  |  | ||||||
| Resources: | Resources: | ||||||
|  |  | ||||||
| @ -154,14 +156,28 @@ Resources: | |||||||
|   LoadBalancing: |   LoadBalancing: | ||||||
|     Type: AWS::CloudFormation::Stack |     Type: AWS::CloudFormation::Stack | ||||||
|     Properties: |     Properties: | ||||||
|       TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/${release}/cloudformation/nakama/load_balancing.yaml' |       TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/nakama/${release}/cloudformation/nakama/load_balancing.yaml' | ||||||
|       Parameters: |       Parameters: | ||||||
|         environment: !Ref environment |         environment: !Ref environment | ||||||
|         release: !Ref release |         release: !Ref release | ||||||
|         VpcId: !Ref VpcId |         VpcId: !Ref VpcId | ||||||
|         PublicSubnets: !Ref PublicSubnets |         PublicSubnets: !Join [",", !Split [" ", !Ref PublicSubnets]] | ||||||
|         PortalCertificate: !Ref PortalCertificate |         PortalCertificate: !Ref PortalCertificate | ||||||
|  |  | ||||||
|  |   #------------- | ||||||
|  |   # ECS Cluster | ||||||
|  |   #------------- | ||||||
|  |   EcsCluster: | ||||||
|  |     Condition: CreateCluster | ||||||
|  |     Type: AWS::CloudFormation::Stack | ||||||
|  |     Properties: | ||||||
|  |       TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/nakama/${release}/cloudformation/cluster/top.yaml' | ||||||
|  |       Parameters: | ||||||
|  |         Environment: !Ref environment | ||||||
|  |         VpcId: !Ref VpcId | ||||||
|  |         SubnetIds: !Join [",", !Split [" ", !Ref PublicSubnets]] | ||||||
|  |         Project: "Nakama" | ||||||
|  |  | ||||||
|   #------------------- |   #------------------- | ||||||
|   # ECS Task & Service |   # ECS Task & Service | ||||||
|   #------------------- |   #------------------- | ||||||
| @ -181,7 +197,7 @@ Resources: | |||||||
|     DependsOn: LoadBalancing |     DependsOn: LoadBalancing | ||||||
|     Type: AWS::ECS::Service |     Type: AWS::ECS::Service | ||||||
|     Properties: |     Properties: | ||||||
|       Cluster: !Ref EcsCluster |       Cluster: !If ["CreateCluster", !GetAtt EcsCluster.Outputs.Cluster, !Ref EcsClusterOverride] | ||||||
|       DesiredCount: 1 |       DesiredCount: 1 | ||||||
|       TaskDefinition: !GetAtt TaskDefinition.Outputs.TaskArn |       TaskDefinition: !GetAtt TaskDefinition.Outputs.TaskArn | ||||||
|       LoadBalancers:   |       LoadBalancers:   | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user