-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (111 loc) · 4.67 KB
/
0.pipeline-ecs-service.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Deploy ECS Service using AWS CloudFormation
on:
workflow_call:
inputs:
aws-region:
required: true
type: string
template-path:
required: true
type: string
template-parameters-path:
required: true
type: string
dockerfile-path:
required: true
type: string
service-name:
required: true
type: string
cluster-name:
required: true
type: string
check-quality-gate:
required: false
type: boolean
default: true
execute-sonar-analysis:
required: false
type: boolean
default: true
quality-gate-name:
required: false
type: string
default: ""
secrets:
aws-access-key-id:
required: true
aws-secret-access-key:
required: true
sonar-token:
required: true
sonar-host-url:
required: true
permissions:
contents: read
jobs:
generate-basic-constants:
uses: devsuperior/dsc-shared-pipelines/.github/workflows/generate-basic-constants.yml@main
build-java-gradle:
uses: devsuperior/dsc-shared-pipelines/.github/workflows/build-java-gradle.yml@main
sonar-analysis:
needs: [build-java-gradle, generate-basic-constants]
uses: devsuperior/dsc-shared-pipelines/.github/workflows/sonar-analysis.yml@main
with:
repository-name: ${{ needs.generate-basic-constants.outputs.repository-name }}
check-quality-gate: ${{ inputs.check-quality-gate }}
execute-sonar-analysis: ${{ inputs.execute-sonar-analysis }}
secrets:
sonar-token: ${{ secrets.sonar-token }}
sonar-host-url: ${{ secrets.sonar-host-url }}
build-push-docker-image:
needs: [sonar-analysis, generate-basic-constants]
uses: devsuperior/dsc-shared-pipelines/.github/workflows/build-push-docker-image.yml@main
with:
environment-name: ${{ needs.generate-basic-constants.outputs.environment-name }}
repository-name: ${{ needs.generate-basic-constants.outputs.repository-name }}
aws-region: ${{ inputs.aws-region }}
dockerfile-path: ${{ inputs.dockerfile-path }}
secrets:
aws-access-key-id: ${{ secrets.aws-access-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
generate-complete-template-parameters:
needs: generate-basic-constants
uses: devsuperior/dsc-shared-pipelines/.github/workflows/generate-complete-template-parameters.yml@main
with:
template-parameters-path: ${{ inputs.template-parameters-path }}
environment-name: ${{ needs.generate-basic-constants.outputs.environment-name }}
repository-name: ${{ needs.generate-basic-constants.outputs.repository-name }}
check-delete-cloud-formation-status:
needs: [build-push-docker-image, generate-basic-constants]
uses: devsuperior/dsc-shared-pipelines/.github/workflows/check-delete-cloud-formation-status.yml@main
with:
aws-region: ${{ inputs.aws-region }}
stack-name: ${{ needs.generate-basic-constants.outputs.stack-name }}
secrets:
aws-access-key-id: ${{ secrets.aws-access-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
deploy-cloud-formation:
needs: [check-delete-cloud-formation-status, generate-complete-template-parameters, generate-basic-constants]
uses: devsuperior/dsc-shared-pipelines/.github/workflows/deploy-cloud-formation.yml@main
with:
aws-region: ${{ inputs.aws-region }}
template-path: ${{ inputs.template-path }}
template-parameters-path: ${{ inputs.template-parameters-path }}
stack-name: ${{ needs.generate-basic-constants.outputs.stack-name }}
complete-template-parameters-base64: ${{ needs.generate-complete-template-parameters.outputs.complete-template-parameters-base64 }}
secrets:
aws-access-key-id: ${{ secrets.aws-access-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
force-deploy-ecs-task-definition:
needs: [deploy-cloud-formation, generate-basic-constants]
uses: devsuperior/dsc-shared-pipelines/.github/workflows/force-deploy-ecs-task-definition.yml@main
with:
aws-region: ${{ inputs.aws-region }}
service-name: ${{ needs.generate-basic-constants.outputs.environment-name }}-${{ inputs.service-name }}
cluster-name: ${{ needs.generate-basic-constants.outputs.environment-name }}-${{ inputs.cluster-name }}
stack-name: ${{ needs.generate-basic-constants.outputs.stack-name }}
cloud-formation-result: ${{ needs.deploy-cloud-formation.outputs.cloud-formation-result }}
secrets:
aws-access-key-id: ${{ secrets.aws-access-key-id }}
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}