-
Notifications
You must be signed in to change notification settings - Fork 41
206 lines (195 loc) · 7.77 KB
/
push-trigger.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Maven Package upon a push
on:
release:
types: [published]
pull_request:
types: [opened, reopened, synchronize]
branches:
- '!release-branch'
- release-1*
- 1.*
- develop
- MOSIP*
workflow_dispatch:
inputs:
message:
description: 'Message for manually triggering'
required: false
default: 'Triggered for Updates'
type: string
push:
branches:
- '!release-branch'
- release-1*
- master
- 1.*
- develop
- MOSIP*
jobs:
build-kafka-admin-client:
uses: mosip/kattu/.github/workflows/maven-build.yml@master
with:
SERVICE_LOCATION: ./kafka-admin-client
BUILD_ARTIFACT: kafka-admin-client
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
publish-to-nexus-kafka-admin-client:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-kafka-admin-client
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master
with:
SERVICE_LOCATION: ./kafka-admin-client
secrets:
OSSRH_URL: ${{ secrets.RELEASE_URL }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
sonar-analysis-kafka-admin-client:
needs: build-kafka-admin-client
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master
with:
SERVICE_LOCATION: ./kafka-admin-client
PROJECT_KEY: 'mosip_kafka-admin-client'
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ORG_KEY: ${{ secrets.ORG_KEY }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
build-consolidator:
needs: build-kafka-admin-client
env:
SERVICE_LOCATION: 'consolidator'
BUILD_ARTIFACT: 'consolidator'
KAFKA_ADMIN_BUILD_ARTIFACT: 'kafka-admin-client'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: AdoptOpenJDK/install-jdk@v1
with:
version: '11'
- name: Download kafka-admin-client artifact
uses: actions/download-artifact@v1
with:
name: ${{ env.KAFKA_ADMIN_BUILD_ARTIFACT }}
path: ./
- name: Unzip the kafka-admin-client
run: |
unzip ${{ env.KAFKA_ADMIN_BUILD_ARTIFACT }}.zip -d ${{ env.SERVICE_LOCATION }}
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Install ballerina
run: |
wget -q --show-progress https://dist.ballerina.io/downloads/2201.0.0/ballerina-2201.0.0-swan-lake-linux-x64.deb -O ballerina-linux-installer-x64.deb
sudo dpkg -i ballerina-linux-installer-x64.deb
- name: Hub-service build
run: |
bal build ./${{ env.SERVICE_LOCATION }}
- name: Ready the springboot artifacts
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
run: |
## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY
cd ${{ env.SERVICE_LOCATION }}
find . -path '*/target/bin/*' -name '*.jar' -type f -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ./${{ env.SERVICE_LOCATION }}/${{ env.BUILD_ARTIFACT }}.zip
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: failure() # Pick up events even if the job fails or is canceled.
build-consolidator-dockers:
needs: build-consolidator
uses: mosip/kattu/.github/workflows/docker-build.yml@master
with:
SERVICE_LOCATION: 'consolidator'
SERVICE_NAME: 'consolidator-websub-service'
BUILD_ARTIFACT: 'consolidator'
ONLY_DOCKER: true
secrets:
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }}
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }}
build-websub:
needs: build-kafka-admin-client
env:
SERVICE_LOCATION: 'hub'
BUILD_ARTIFACT: 'websub-service'
KAFKA_ADMIN_BUILD_ARTIFACT: 'kafka-admin-client'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: AdoptOpenJDK/install-jdk@v1
with:
version: '11'
- name: Download kafka-admin-client artifact
uses: actions/download-artifact@v1
with:
name: ${{ env.KAFKA_ADMIN_BUILD_ARTIFACT }}
path: ./
- name: Unzip the kafka-admin-client
run: |
unzip ${{ env.KAFKA_ADMIN_BUILD_ARTIFACT }}.zip -d ${{ env.SERVICE_LOCATION }}
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Install ballerina
run: |
wget -q --show-progress https://dist.ballerina.io/downloads/2201.0.0/ballerina-2201.0.0-swan-lake-linux-x64.deb -O ballerina-linux-installer-x64.deb
sudo dpkg -i ballerina-linux-installer-x64.deb
- name: Hub-service build
run: |
bal build ./${{ env.SERVICE_LOCATION }}
- name: Ready the springboot artifacts
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
run: |
## FIND JARS & COPY ONLY EXECUTABLE JARs STORED UNDER TARGET DIRECTORY
cd ${{ env.SERVICE_LOCATION }}
find . -path '*/target/bin/*' -name '*.jar' -type f -exec zip ${{ env.BUILD_ARTIFACT }}.zip {} +
- name: Upload the springboot jars
if: ${{ !contains(github.ref, 'master') || !contains(github.ref, 'main') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.BUILD_ARTIFACT }}
path: ./${{ env.SERVICE_LOCATION }}/${{ env.BUILD_ARTIFACT }}.zip
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,commit,workflow,job # selectable (default: repo,message)
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: failure() # Pick up events even if the job fails or is canceled.
build-websub-dockers:
needs: build-websub
uses: mosip/kattu/.github/workflows/docker-build.yml@master
with:
SERVICE_LOCATION: 'hub'
SERVICE_NAME: 'websub-service'
BUILD_ARTIFACT: 'websub-service'
ONLY_DOCKER: true
secrets:
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}
ACTOR_DOCKER_HUB: ${{ secrets.ACTOR_DOCKER_HUB }}
RELEASE_DOCKER_HUB: ${{ secrets.RELEASE_DOCKER_HUB }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_DEVOPS }}