Skip to content

Commit 6fe0b8e

Browse files
authored
Merge pull request #6 from devsocket/feature/ci_cd_k8s_support
added profile support
2 parents 8532b35 + 9497249 commit 6fe0b8e

File tree

17 files changed

+408
-13
lines changed

17 files changed

+408
-13
lines changed

.github/workflows/develop-pipeline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Deploy to Local Kubernetes
33
on:
44
push:
55
branches:
6-
- feature/*
6+
- 'develop'
77

88
jobs:
99
build-and-deploy:

.github/workflows/feature-pipeline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and Deploy to Local Kubernetes
33
on:
44
push:
55
branches:
6-
- feature/*
6+
- 'feature/**'
77

88
jobs:
99
build-and-deploy:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#-------------------------------------------------------------------------------#
2+
# Discover all capabilities of Qodana in our documentation #
3+
# https://www.jetbrains.com/help/qodana/about-qodana.html #
4+
#-------------------------------------------------------------------------------#
5+
6+
name: Qodana
7+
on:
8+
workflow_dispatch:
9+
pull_request:
10+
push:
11+
branches:
12+
- develop
13+
- master
14+
- feature/**
15+
16+
jobs:
17+
qodana:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
checks: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.event.pull_request.head.sha }}
27+
fetch-depth: 0
28+
- name: 'Qodana Scan'
29+
uses: JetBrains/qodana-action@v2025.2
30+
env:
31+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
32+
with:
33+
# In pr-mode: 'true' Qodana checks only changed files
34+
pr-mode: false
35+
use-caches: true
36+
post-pr-comment: true
37+
use-annotations: true
38+
# Upload Qodana results (SARIF, other artifacts, logs) as an artifact to the job
39+
upload-result: false
40+
# quick-fixes available in Ultimate and Ultimate Plus plans
41+
push-fixes: 'none'

k8s/deployments/order-service-deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ spec:
3333
- name: SPRING_JPA_PROPERTIES_HIBERNATE_DEFAULT_SCHEMA
3434
value: order
3535
- name: KAFKA_BOOTSTRAP_SERVERS
36-
value: kafka:9092
36+
value: kafka:9092
37+
- name: SPRING_PROFILES_ACTIVE
38+
value: dev

k8s/deployments/product-service-deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ spec:
3333
- name: SPRING_JPA_PROPERTIES_HIBERNATE_DEFAULT_SCHEMA
3434
value: product
3535
- name: KAFKA_BOOTSTRAP_SERVERS
36-
value: kafka:9092
36+
value: kafka:9092
37+
- name: SPRING_PROFILES_ACTIVE
38+
value: dev

k8s/deployments/user-service-deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ spec:
3333
- name: SPRING_JPA_PROPERTIES_HIBERNATE_DEFAULT_SCHEMA
3434
value: user
3535
- name: KAFKA_BOOTSTRAP_SERVERS
36-
value: kafka:9092
36+
value: kafka:9092
37+
- name: SPRING_PROFILES_ACTIVE
38+
value: dev

order-service/src/main/resources/application.yaml renamed to order-service/src/main/resources/application-dev.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ spring:
2626
topic: topic.v1.orders
2727
topic-partitions: 2
2828
topic-replication-factor: 1
29+
properties:
30+
security.protocol: SASL_SSL
31+
sasl.mechanism: PLAIN
32+
sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="${EVENT_HUBS_CONNECTION_STRING}";
33+
2934
consumer:
3035
group-id: order-service-group
3136
auto-offset-reset: earliest
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
server:
2+
port: 8085
3+
4+
spring:
5+
application:
6+
name: order-service
7+
8+
datasource:
9+
url: ${SPRING_DATASOURCE_URL}
10+
username: ${SPRING_DATASOURCE_USERNAME}
11+
password: ${SPRING_DATASOURCE_PASSWORD}
12+
driver-class-name: org.postgresql.Driver
13+
jpa:
14+
hibernate:
15+
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:update}
16+
properties:
17+
hibernate:
18+
default_schema: order
19+
20+
jwt:
21+
secret: ${JWT_SECRET}
22+
23+
kafka:
24+
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS}
25+
topic: topic.v1.orders
26+
topic-partitions: 2
27+
topic-replication-factor: 1
28+
properties:
29+
security.protocol: SASL_SSL
30+
sasl.mechanism: PLAIN
31+
sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="${EVENT_HUBS_CONNECTION_STRING}";
32+
consumer:
33+
group-id: order-service-group
34+
auto-offset-reset: earliest
35+
# key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
36+
# value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
37+
producer:
38+
key-serializer: org.apache.kafka.common.serialization.StringSerializer
39+
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
40+
41+
logging:
42+
level:
43+
root: INFO
44+
org.springframework.security: INFO
45+
com.devsocket.ecommerce.orderservice: INFO
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
server:
2+
port: 8085
3+
4+
spring:
5+
application:
6+
name: order-service
7+
8+
datasource:
9+
url: ${SPRING_DATASOURCE_URL}
10+
username: ${SPRING_DATASOURCE_USERNAME}
11+
password: ${SPRING_DATASOURCE_PASSWORD}
12+
driver-class-name: org.postgresql.Driver
13+
jpa:
14+
hibernate:
15+
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:update}
16+
properties:
17+
hibernate:
18+
default_schema: order
19+
20+
jwt:
21+
secret: ${JWT_SECRET}
22+
23+
kafka:
24+
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS}
25+
topic: topic.v1.orders
26+
topic-partitions: 2
27+
topic-replication-factor: 1
28+
properties:
29+
security.protocol: SASL_SSL
30+
sasl.mechanism: PLAIN
31+
sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="${EVENT_HUBS_CONNECTION_STRING}";
32+
consumer:
33+
group-id: order-service-group
34+
auto-offset-reset: earliest
35+
# key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
36+
# value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
37+
producer:
38+
key-serializer: org.apache.kafka.common.serialization.StringSerializer
39+
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
40+
41+
logging:
42+
level:
43+
root: INFO
44+
org.springframework.security: INFO
45+
com.devsocket.ecommerce.userservice: INFO

port-forward.log

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Forwarding from 127.0.0.1:80 -> 80
2+
Forwarding from [::1]:80 -> 80
3+
Handling connection for 80
4+
Handling connection for 80
5+
Handling connection for 80
6+
Handling connection for 80
7+
Handling connection for 80
8+
Handling connection for 80
9+
Handling connection for 80
10+
Handling connection for 80
11+
Handling connection for 80
12+
Handling connection for 80
13+
Handling connection for 80
14+
Handling connection for 80
15+
Handling connection for 80
16+
Handling connection for 80
17+
Handling connection for 80
18+
Handling connection for 80
19+
Handling connection for 80
20+
Handling connection for 80
21+
error: lost connection to pod

0 commit comments

Comments
 (0)