-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (115 loc) · 5.19 KB
/
ci-cd-caseflow-dev.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
122
123
124
125
name: Continuous Integration And Deployment On Push to DEV
on:
workflow_dispatch: # TODO this is there for testing purposes, once the pipelines are all done, remove this
push:
branches:
- 'master'
- 'caseflow-ci-cd' #sakthi
paths:
- 'app/**'
- 'app/caseflow_core/**'
- 'app/caseflow_web/**'
- '.github/workflows/ci-cd-openshift-dev.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
builds:
name: Builds Microservices
uses: ./.github/workflows/_build.yml
strategy:
matrix:
component: [app/caseflow_core/microservices/dms, app/caseflow_core/microservices/gateway, app/caseflow_core/microservices/lob, app/caseflow_core/microservices/server]
include:
- component: app/caseflow_core/microservices/dms
triggers: ('app/caseflow_core/microservices/dms/')
- component: app/caseflow_core/microservices/gateway
triggers: ('app/caseflow_core/microservices/gateway/')
- component: app/caseflow_core/microservices/lob
triggers: ('app/caseflow_core/microservices/lob/')
- component: app/caseflow_core/microservices/server
triggers: ('app/caseflow_core/microservices/server/')
# - component: app/caseflow_web
# triggers: ('app/caseflow_web/')
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
component: ${{ matrix.component }}
img_build: "dev" # ask the team dev or latest
img_fallback: dev
triggers: ${{ matrix.triggers }}
builds_web:
name: Builds Web
uses: ./.github/workflows/build_web.yml
strategy:
matrix:
component: [app/caseflow_web]
include:
- component: app/caseflow_web
triggers: ('app/caseflow_web/')
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
component: ${{ matrix.component }}
img_build: "dev" # ask the team dev or latest
img_fallback: dev
triggers: ${{ matrix.triggers }}
# # TODO - REIMPLMENET BEFORE MERGING, JUST TESTING WITHOUT THESE TO VERIFY DEPLOYS
# tests:
# name: Unit Tests
# uses: ./.github/workflows/_code-cov.yml
# strategy:
# matrix:
# component: [app/caseflow_core/microservices/dms, app/caseflow_core/microservices/gateway, app/caseflow_core/microservices/lob, app/caseflow_core/microservices/server, app/caseflow_web]
# secrets:
# gh_token: ${{ secrets.GITHUB_TOKEN }}
# with:
# component: ${{ matrix.component }}
# lcov_file: ${{ matrix.component }}/coverage/lcov.info
# test_cmd: npm run test:cov
deploys:
name: Deploys
needs:
- builds
# If any of the previous created a build, then deploy
# TODO - RE-ENABLE IF COMMAND BELOW, DISABLED DURING EXPERIMENTAL DEV
if: contains(needs.*.outputs.build, 'true')
uses: ./.github/workflows/_deploy.yml
strategy:
matrix:
component: [app/caseflow_core/microservices/dms, app/caseflow_core/microservices/gateway, app/caseflow_core/microservices/lob, app/caseflow_core/microservices/server, app/caseflow_web]
include:
# - component: database
# overwrite: false
# template_file: .github/openshift/deploy.database.yml
# template_vars: -p DB_PVC_SIZE=200Mi
- component: app/caseflow_web
overwrite: true
template_file: .github/openshift/deploy.caseflow-web.yml
template_vars: -p PROMOTE=${{ github.repository }}/app/caseflow_web -p CONTAINER_PORT=8080 -p ENV=dev -p IMAGE_TAG=dev
- component: app/caseflow_core/microservices/dms
overwrite: true
template_file: .github/openshift/deploy.microservice-dms.yml
template_vars: -p PROMOTE=${{ github.repository }}/app/caseflow_core/microservices/dms -p CONTAINER_PORT=7002 -p ENV=dev -p IMAGE_TAG=dev
- component: app/caseflow_core/microservices/gateway
overwrite: true
template_file: .github/openshift/deploy.microservice-gateway.yml
template_vars: -p PROMOTE=${{ github.repository }}/app/caseflow_core/microservices/gateway -p CONTAINER_PORT=7000 -p ENV=dev -p IMAGE_TAG=dev
- component: app/caseflow_core/microservices/lob
overwrite: true
template_file: .github/openshift/deploy.microservice-lob.yml
template_vars: -p PROMOTE=${{ github.repository }}/app/caseflow_core/microservices/lob -p CONTAINER_PORT=8000 -p ENV=dev -p IMAGE_TAG=dev
- component: app/caseflow_core/microservices/server
overwrite: true
template_file: .github/openshift/deploy.microservice-server.yml
template_vars: -p PROMOTE=${{ github.repository }}/app/caseflow_core/microservices/server -p CONTAINER_PORT=7001 -p ENV=dev -p IMAGE_TAG=dev
secrets:
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
with:
environment: dev
component: ${{ matrix.component }}
overwrite: ${{ matrix.overwrite }}
template_file: ${{ matrix.template_file }}
template_vars: ${{ matrix.template_vars }}