Skip to content

Commit 2cb11f9

Browse files
committed
"chore: trigger CD pipeline"
1 parent aca506b commit 2cb11f9

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/cd.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,34 @@ jobs:
4848
cache-from: type=gha
4949
cache-to: type=gha,mode=max
5050

51-
- name: Trigger Render deploy
51+
- name: Deploy to Oracle Cloud VM
5252
env:
53-
RENDER_DEPLOY_HOOK_URL: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
54-
run: curl -fsSL -X POST "${RENDER_DEPLOY_HOOK_URL}"
53+
OCI_HOST: ${{ secrets.OCI_HOST }}
54+
OCI_USER: ${{ secrets.OCI_USER }}
55+
OCI_SSH_KEY: ${{ secrets.OCI_SSH_KEY }}
56+
IMAGE: zufarexplainedit/iced-latte-backend:latest
57+
run: |
58+
echo "${OCI_SSH_KEY}" > /tmp/oci_key && chmod 600 /tmp/oci_key
59+
ssh -o StrictHostKeyChecking=no -i /tmp/oci_key ${OCI_USER}@${OCI_HOST} "
60+
docker pull ${IMAGE} &&
61+
docker stop iced-latte-backend 2>/dev/null || true &&
62+
docker rm iced-latte-backend 2>/dev/null || true &&
63+
docker run -d --name iced-latte-backend --restart unless-stopped \
64+
--env-file /home/${OCI_USER}/iced-latte.env \
65+
-p 8083:8083 \
66+
--memory=768m --memory-swap=768m \
67+
-e JAVA_TOOL_OPTIONS='-Xmx512m' \
68+
${IMAGE}
69+
"
70+
rm -f /tmp/oci_key
5571
5672
- name: Wait for application to come up
5773
env:
58-
RENDER_APP_URL: ${{ secrets.RENDER_APP_URL }}
74+
OCI_HOST: ${{ secrets.OCI_HOST }}
5975
run: |
6076
echo "Waiting for deploy to complete..."
6177
for i in $(seq 1 36); do
62-
STATUS=$(curl -sf "${RENDER_APP_URL}/actuator/health" \
78+
STATUS=$(curl -sf "http://${OCI_HOST}:8083/actuator/health" \
6379
| python3 -c "import sys,json; print(json.load(sys.stdin).get('status',''))" 2>/dev/null)
6480
if [ "$STATUS" = "UP" ]; then
6581
echo "[OK] Application is UP"

src/main/resources/application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spring:
4444
# Database Properties
4545
#
4646
datasource:
47-
url: jdbc:postgresql://${DATASOURCE_HOST}:${DATASOURCE_PORT}/${DATASOURCE_NAME}?serverTimezone=UTC&sslmode=${DATASOURCE_SSL_MODE:disable}
47+
url: jdbc:postgresql://${DATASOURCE_HOST}:${DATASOURCE_PORT}/${DATASOURCE_NAME}?serverTimezone=UTC&sslmode=${DATASOURCE_SSL_MODE:disable}&prepareThreshold=0
4848
username: ${DATASOURCE_USERNAME}
4949
password: ${DATASOURCE_PASSWORD}
5050
hikari:

0 commit comments

Comments
 (0)