Skip to content

Commit 284acce

Browse files
ArneLimburgnilshartmann96
authored andcommitted
feat: Use webhooks updated
1 parent aaa2e72 commit 284acce

31 files changed

Lines changed: 611 additions & 69 deletions

address-validation-service/Jenkinsfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@ pipeline {
2323

2424
triggers {
2525
pollSCM("* * * * *")
26+
GenericTrigger(
27+
genericRequestVariables: [
28+
[key: 'branch', regexpFilter: ''],
29+
[key: 'verifyPacts', regexpFilter: '']
30+
],
31+
32+
causeString: 'Triggered by web hook',
33+
34+
token: 'address-validation-service',
35+
36+
printContributedVariables: true,
37+
printPostContent: true,
38+
39+
silentResponse: false,
40+
41+
regexpFilterText: '$branch',
42+
regexpFilterExpression: ".*${(env.BRANCH_NAME == 'main' ? 'main' : 'develop')}.*"
43+
)
2644
}
2745

2846
stages {
@@ -61,6 +79,9 @@ pipeline {
6179
stage ('Test') {
6280
when {
6381
anyOf {
82+
expression {
83+
params.verifyPacts == true
84+
}
6485
not {
6586
branch 'main'
6687
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: address-validation-deployment
5+
labels:
6+
app: address-validation-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: address-validation-service
12+
template:
13+
metadata:
14+
labels:
15+
app: address-validation-service
16+
spec:
17+
containers:
18+
- name: address-validation
19+
image: address-validation:latest
20+
ports:
21+
- containerPort: 4003
22+
name: http
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- deployment.yaml
6+
- service.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: address-validation-service
5+
spec:
6+
selector:
7+
app: address-validation-service
8+
type: NodePort
9+
ports:
10+
- protocol: TCP
11+
port: 4003
12+
targetPort: 4003
13+
nodePort: 30090
14+
name: service
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: prod
5+
6+
resources:
7+
- ../../base
8+
9+
patches:
10+
- target:
11+
version: v1
12+
kind: Service
13+
name: address-validation-service
14+
path: ./patches/port-patch.yaml
15+
16+
images:
17+
- name: address-validation
18+
newName: localhost:30010/address-validation
19+
newTag: 1.1.0-SNAPSHOT
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: address-validation-service
5+
spec:
6+
selector:
7+
app: address-validation-service
8+
type: NodePort
9+
ports:
10+
- protocol: TCP
11+
port: 4003
12+
targetPort: 4003
13+
nodePort: 31090
14+
name: service
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: test
5+
6+
resources:
7+
- ../../base
8+
9+
images:
10+
- name: address-validation
11+
newName: localhost:30010/address-validation
12+
newTag: 1.1.0-SNAPSHOT

address-validation-service/src/test/pacts/delivery-service-address-validation-service.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
],
141141
"metadata": {
142142
"pact-jvm": {
143-
"version": "4.6.15"
143+
"version": "4.6.19"
144144
},
145145
"pactSpecification": {
146146
"version": "4.0"

billing-service/Jenkinsfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@ pipeline {
2323

2424
triggers {
2525
pollSCM("* * * * *")
26+
GenericTrigger(
27+
genericRequestVariables: [
28+
[key: 'branch', regexpFilter: ''],
29+
[key: 'verifyPacts', regexpFilter: '']
30+
],
31+
32+
causeString: 'Triggered by web hook',
33+
34+
token: 'billing-service',
35+
36+
printContributedVariables: true,
37+
printPostContent: true,
38+
39+
silentResponse: false,
40+
41+
regexpFilterText: '$branch',
42+
regexpFilterExpression: ".*${(env.BRANCH_NAME == 'main' ? 'main' : 'develop')}.*"
43+
)
2644
}
2745

2846
stages {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: billing-deployment
5+
labels:
6+
app: billing-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: billing-service
12+
template:
13+
metadata:
14+
labels:
15+
app: billing-service
16+
spec:
17+
containers:
18+
- name: billing
19+
image: billing:latest
20+
ports:
21+
- containerPort: 4001
22+
name: http

0 commit comments

Comments
 (0)