Skip to content

Commit dfca98a

Browse files
authored
merge: chore/automatic-cd to develop (#13)
2 parents 60304c2 + 58bd9c4 commit dfca98a

File tree

10 files changed

+129
-10
lines changed

10 files changed

+129
-10
lines changed

.github/workflows/cd-app-develop.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy to NCP
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v3
15+
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: 21
20+
distribution: temurin
21+
22+
- name: Build core-api jar
23+
run: ./gradlew :noweekend-core:core-api:clean :noweekend-core:core-api:bootJar
24+
25+
- name: Build core-api Docker image
26+
run: docker build -t core-api:latest -f ./noweekend-core/core-api/Dockerfile ./noweekend-core/core-api
27+
28+
- name: Save Docker images as tar
29+
run: |
30+
docker save core-api:latest -o core-api.tar
31+
sleep 2
32+
33+
- name: Fix permissions for all artifacts
34+
run: chmod 644 core-api.tar docker-compose.app.yml
35+
36+
- name: Zip up deploy artifacts
37+
run: zip deploy-artifacts.zip core-api.tar docker-compose.app.yml
38+
39+
- name: SCP zipped artifacts to NCP
40+
uses: appleboy/[email protected]
41+
with:
42+
host: ${{ secrets.NCP_SERVER_HOST }}
43+
username: root
44+
key: ${{ secrets.NCP_SSH_KEY }}
45+
source: deploy-artifacts.zip
46+
target: /root/organized/app/
47+
debug: true
48+
49+
- name: SSH into server and deploy
50+
uses: appleboy/[email protected]
51+
with:
52+
host: ${{ secrets.NCP_SERVER_HOST }}
53+
username: root
54+
key: ${{ secrets.NCP_SSH_KEY }}
55+
script: |
56+
cd /root/organized/app
57+
rm -f core-api.tar docker-compose.app.yml
58+
unzip -o deploy-artifacts.zip
59+
rm -f deploy-artifacts.zip
60+
docker load -i core-api.tar
61+
docker compose -f docker-compose.app.yml up -d

docker-compose.app.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "3.9"
2+
services:
3+
core-api:
4+
image: core-api:latest
5+
ports:
6+
- "8080:8080"
7+
environment:
8+
JASYPT_ENCRYPTOR_PASSWORD: ${JASYPT_ENCRYPTOR_PASSWORD}
9+
SPRING_PROFILES_ACTIVE: staging
10+
SERVER_PORT: 8080
11+
networks:
12+
- mashupnet
13+
14+
networks:
15+
mashupnet:
16+
external: true

docker-compose.db.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: "3.9"
2+
services:
3+
mysql:
4+
image: mysql:8.0
5+
environment:
6+
MYSQL_ROOT_PASSWORD: mash-up-noweekend
7+
MYSQL_USER: mash-up-noweekend
8+
MYSQL_PASSWORD: mash-up-noweekend
9+
ports:
10+
- "3306:3306"
11+
volumes:
12+
- mysql-data:/var/lib/mysql
13+
networks:
14+
- mashupnet
15+
16+
redis:
17+
image: redis:7.2
18+
ports:
19+
- "6379:6379"
20+
networks:
21+
- mashupnet
22+
volumes:
23+
mysql-data:
24+
25+
networks:
26+
mashupnet:
27+
external: true

noweekend-core/core-api/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM eclipse-temurin:21-jre
2+
WORKDIR /app
3+
COPY build/libs/core-api-*.jar app.jar
4+
ENTRYPOINT ["java", "-jar", "app.jar"]

noweekend-core/core-api/src/main/resources/application.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ spring:
1212
- domain.yml
1313
web.resources.add-mappings: false
1414

15+
jasypt:
16+
encryptor:
17+
password: ${JASYPT_ENCRYPTOR_PASSWORD}
18+
1519
server:
1620
tomcat:
1721
max-connections: 20000

noweekend-core/core-domain/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ dependencies {
77
implementation("org.springframework:spring-tx")
88

99
// JWT
10-
implementation("io.jsonwebtoken:jjwt-api:0.12.6")
11-
implementation("io.jsonwebtoken:jjwt-impl:0.12.6")
12-
implementation("io.jsonwebtoken:jjwt-jackson:0.12.6")
10+
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
1311

1412
// jasypt
1513
implementation("com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5")

noweekend-mcp/mcp-host/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM eclipse-temurin:21-jre
2+
WORKDIR /app
3+
COPY build/libs/mcp-host-*.jar app.jar
4+
ENTRYPOINT ["java", "-jar", "app.jar"]

noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/config/MyAgentState.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package noweekend.mcphost.config
33
import org.bsc.langgraph4j.state.AgentState
44
import org.bsc.langgraph4j.state.Channel
55
import org.bsc.langgraph4j.state.Channels
6+
import java.util.function.Supplier
67

78
class MyAgentState(initData: Map<String, Any>) : AgentState(initData) {
89

@@ -18,9 +19,9 @@ class MyAgentState(initData: Map<String, Any>) : AgentState(initData) {
1819
companion object {
1920
@JvmStatic
2021
val SCHEMA: Map<String, Channel<*>> = mapOf(
21-
"question" to Channels.base { "" },
22-
"chat_response" to Channels.base { "" },
23-
"weather_json" to Channels.base { "" },
22+
"question" to Channels.base(Supplier { "" }),
23+
"chat_response" to Channels.base(Supplier { "" }),
24+
"weather_json" to Channels.base(Supplier { "" }),
2425
)
2526
}
2627
}

noweekend-mcp/mcp-server/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM eclipse-temurin:21-jre
2+
WORKDIR /app
3+
COPY build/libs/mcp-server-*.jar app.jar
4+
ENTRYPOINT ["java", "-jar", "app.jar"]

noweekend-storage/db-core/src/main/resources/db-core.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ storage:
2424
driver-class-name: com.mysql.cj.jdbc.Driver
2525
jdbc-url: jdbc:mysql://localhost:3306/noweekend
2626
username: root
27-
password: 12345678
27+
password: mash-up-noweekend
2828
pool-name: core-db-pool
2929
data-source-properties:
3030
rewriteBatchedStatements: true
@@ -101,9 +101,9 @@ storage:
101101
datasource:
102102
core:
103103
driver-class-name: com.mysql.cj.jdbc.Driver
104-
jdbc-url: jdbc:mysql://${storage.database.core-db.url}
105-
username: ${storage.database.core-db.username}
106-
password: ${storage.database.core-db.password}
104+
jdbc-url: jdbc:mysql://mysql:3306/noweekend
105+
username: root
106+
password: mash-up-noweekend
107107
maximum-pool-size: 5
108108
connection-timeout: 1100
109109
keepalive-time: 30000

0 commit comments

Comments
 (0)