Compare commits

..

13 Commits

Author SHA1 Message Date
Gilmour109 758808e4d0 Update .drone.yml
continuous-integration/drone/push Build is failing
2026-02-26 18:12:37 +00:00
Gilmour109 30d7fd881e Update .drone.yml
continuous-integration/drone/push Build is failing
2026-02-26 17:48:18 +00:00
Gilmour109 9935adbcbd push on main branch leads to loading up apk into garage storage
continuous-integration/drone/push Build is failing
2026-02-26 17:38:19 +01:00
Gilmour109 4f5737d27e prepare step for shared
continuous-integration/drone/push Build is failing
2026-02-26 15:52:59 +01:00
Gilmour109 3492d5bdc8 MMMMMOOOOOORRRRREEEEE... meh
continuous-integration/drone/push Build is failing
2026-02-26 14:52:04 +01:00
Gilmour109 f5ed9a77c3 event more meh
continuous-integration/drone/push Build is failing
2026-02-26 14:38:52 +01:00
Gilmour109 fd896eb380 more meh
continuous-integration/drone/push Build is failing
2026-02-26 14:34:51 +01:00
Gilmour109 93077eb39c meh
continuous-integration/drone/push Build encountered an error
2026-02-26 14:34:02 +01:00
Gilmour109 56af2f25f6 trigger pipeline
continuous-integration/drone/push Build is failing
2026-02-26 14:13:19 +01:00
Gilmour109 f155ff88c8 added APK build and Gitea release to CI pipelines 2026-02-26 13:59:22 +01:00
Gilmour109 d29b8df9e3 longer timeout
continuous-integration/drone/push Build was killed
2026-02-25 22:05:32 +01:00
Gilmour109 ad7d846604 formatting
continuous-integration/drone/push Build is failing
2026-02-25 21:44:40 +01:00
Gilmour109 15804a5605 added version endpoint
continuous-integration/drone/push Build is failing
2026-02-25 21:42:21 +01:00
6 changed files with 136 additions and 121 deletions
+119 -114
View File
@@ -1,47 +1,47 @@
kind: pipeline
type: docker
name: server_build_and_test
trigger:
branch:
- main
event:
- push
steps:
- name: build_server
image: node
commands:
- npm ci -w @calchat/shared
- npm ci -w @calchat/server
- npm run build -w @calchat/server
- name: jest_server
image: node
commands:
- npm run test -w @calchat/server
---
kind: pipeline
type: docker
name: check_for_formatting
trigger:
branch:
- main
event:
- push
steps:
- name: format_check
image: node
commands:
- npm ci
- npm run check_format
---
# kind: pipeline
# type: docker
# name: server_build_and_test
#
# trigger:
# branch:
# - main
# event:
# - push
#
# steps:
# - name: build_server
# image: node
# commands:
# - npm ci -w @calchat/shared
# - npm ci -w @calchat/server
# - npm run build -w @calchat/server
#
# - name: jest_server
# image: node
# commands:
# - npm run test -w @calchat/server
#
# ---
#
# kind: pipeline
# type: docker
# name: check_for_formatting
#
# trigger:
# branch:
# - main
# event:
# - push
#
# steps:
# - name: format_check
# image: node
# commands:
# - npm ci
# - npm run check_format
#
# ---
#
kind: pipeline
type: docker
name: deploy_latest
@@ -53,40 +53,63 @@ trigger:
- push
steps:
- name: upload_latest
image: plugins/docker
settings:
registry: gitea.gilmour109.de
repo: gitea.gilmour109.de/gilmour109/calchat-server
dockerfile: apps/server/docker/Dockerfile
tags:
- latest
username:
from_secret: gitea_username
password:
from_secret: gitea_password
# - name: upload_latest
# image: plugins/docker
# settings:
# registry: gitea.gilmour109.de
# repo: gitea.gilmour109.de/gilmour109/calchat-server
# dockerfile: apps/server/docker/Dockerfile
# tags:
# - latest
# username:
# from_secret: gitea_username
# password:
# from_secret: gitea_password
#
# - name: deploy_to_vps
# image: appleboy/drone-ssh
# settings:
# host:
# - 10.0.0.1
# username: root
# password:
# from_secret: vps_ssh_password
# envs:
# - gitea_username
# - gitea_password
# port: 22
# command_timeout: 10m
# script:
# - docker login -u $GITEA_USERNAME -p $GITEA_PASSWORD gitea.gilmour109.de
# - docker pull gitea.gilmour109.de/gilmour109/calchat-server:latest
# - docker compose -f /root/calchat-mongo/docker-compose.yml up -d
- name: deploy_to_vps
image: appleboy/drone-ssh
settings:
host:
- 10.0.0.1
username: root
password:
from_secret: vps_ssh_password
envs:
- gitea_username
- gitea_password
port: 22
command_timeout: 2m
script:
- docker login -u $GITEA_USERNAME -p $GITEA_PASSWORD gitea.gilmour109.de
- docker pull gitea.gilmour109.de/gilmour109/calchat-server:latest
- docker compose -f /root/calchat-mongo/docker-compose.yml up -d
- name: build_apk
image: gitea.gilmour109.de/gilmour109/eas-build:latest
environment:
EXPO_TOKEN:
from_secret: expo_token
commands:
- npm ci
- npm run build -w @calchat/shared
- npm run -w @calchat/client build:apk
depends_on:
- server_build_and_test
- check_for_formatting
- name: upload_apk
image: plugins/s3
settings:
endpoint: https://garage.gilmour109.de
bucket: calchat-releases
access_key:
from_secret: calchat_drone_garage_access_key
secret_key:
from_secret: calchat_drone_garage_secret_key
source: calchat.apk
target: /
path_style: true
# depends_on:
# - server_build_and_test
# - check_for_formatting
---
@@ -122,50 +145,32 @@ steps:
from_secret: k3s_ssh_password
envs:
- drone_tag
- drone_commit_sha
port: 22
command_timeout: 2m
command_timeout: 10m
script:
- export TAG=$DRONE_TAG
- export NAME=$(echo $DRONE_TAG | tr -d '.')
- export COMMIT=$DRONE_COMMIT_SHA
- envsubst < /home/debian/manifest.yml | sudo kubectl apply -f -
---
- name: build_apk
image: gitea.gilmour109.de/gilmour109/eas-build:latest
environment:
EXPO_TOKEN:
from_secret: expo_token
commands:
- npm ci
- npm run build -w @calchat/shared
- npm run -w @calchat/client build:apk
kind: pipeline
type: docker
name: upload_commit
trigger:
event:
- promote
steps:
- name: upload_commit
image: plugins/docker
- name: release_apk
image: plugins/gitea-release
settings:
registry: gitea.gilmour109.de
repo: gitea.gilmour109.de/gilmour109/calchat-server
dockerfile: apps/server/docker/Dockerfile
tags:
- ${DRONE_COMMIT_SHA:0:8}
username:
from_secret: gitea_username
password:
from_secret: gitea_password
api_key:
from_secret: gitea_token
base_url: https://gitea.gilmour109.de
files:
- calchat.apk
title: ${DRONE_TAG}
- name: deploy_to_k3s
image: appleboy/drone-ssh
settings:
host:
- 192.168.178.201
username: debian
password:
from_secret: k3s_ssh_password
envs:
- drone_commit_sha
port: 22
command_timeout: 2m
script:
- export TAG=$(echo $DRONE_COMMIT_SHA | cut -c1-8)
- export NAME=$TAG
- envsubst < /home/debian/manifest.yml | sudo kubectl apply -f -
+6 -5
View File
@@ -62,7 +62,7 @@ npm run test -w @calchat/server # Run Jest unit tests
| | ical.js | iCalendar parsing/generation |
| Testing | Jest / ts-jest | Server unit tests |
| Deployment | Docker | Server containerization (multi-stage build) |
| | Drone CI | CI/CD pipelines (build, test, format check, deploy) |
| | Drone CI | CI/CD pipelines (build, test, format check, deploy, APK build + Gitea release) |
| Planned | iCalendar | Event export/import |
## Architecture
@@ -684,8 +684,9 @@ This uses the `preview` profile from `eas.json` which builds an APK with:
- `arm64-v8a` architecture only (smaller APK size)
- No credentials required (`withoutCredentials: true`)
- Internal distribution
- Non-interactive mode with fixed output path (`calchat.apk`) for CI compatibility
**Requirements:** Android SDK and Java must be installed locally.
**Requirements:** Android SDK and Java must be installed locally. In CI, the `eas-build` Docker image (`gitea.gilmour109.de/gilmour109/eas-build:latest`) provides the build environment with `EXPO_TOKEN` for authentication.
**EAS Configuration:** `apps/client/eas.json` contains build profiles:
- `development`: Development client with internal distribution
@@ -703,13 +704,13 @@ The project uses Drone CI (`.drone.yml`) with five pipelines:
**On push to main:**
1. **`server_build_and_test`**: Builds the server (`npm ci` + `npm run build`) and runs Jest tests (`npm run test`)
2. **`check_for_formatting`**: Checks Prettier formatting across all workspaces (`npm run check_format`)
3. **`deploy_latest`**: Builds Docker image, pushes to Gitea Container Registry (`gitea.gilmour109.de/gilmour109/calchat-server:latest`), then SSHs into VPS (`10.0.0.1`) to pull and restart via `docker compose`. Depends on both pipelines above passing first.
3. **`deploy_latest`**: Builds Docker image, pushes to Gitea Container Registry (`gitea.gilmour109.de/gilmour109/calchat-server:latest`), then SSHs into VPS (`10.0.0.1`) to pull and restart via `docker compose`. Builds APK via `eas-build` Docker image and creates a Gitea release (title "latest") with the APK. Depends on both pipelines above passing first.
**On tag:**
4. **`upload_tag`**: Builds Docker image tagged with the git tag (`${DRONE_TAG}`), pushes to registry, then deploys to k3s cluster (`192.168.178.201`) via SSH using `envsubst` with a Kubernetes manifest template.
4. **`upload_tag`**: Builds Docker image tagged with the git tag (`${DRONE_TAG}`), pushes to registry, then deploys to k3s cluster (`192.168.178.201`) via SSH using `envsubst` with a Kubernetes manifest template. Builds APK and creates a Gitea release tagged with `${DRONE_TAG}`.
**On promote:**
5. **`upload_commit`**: Builds Docker image tagged with short commit SHA (first 8 chars), pushes to registry, then deploys to k3s cluster (`192.168.178.201`) via SSH using `envsubst` with a Kubernetes manifest template.
5. **`upload_commit`**: Builds Docker image tagged with short commit SHA (first 8 chars), pushes to registry, then deploys to k3s cluster (`192.168.178.201`) via SSH using `envsubst` with a Kubernetes manifest template. Builds APK and creates a Gitea release tagged with the short commit SHA.
## Testing
Binary file not shown.
+1 -1
View File
@@ -9,7 +9,7 @@
"ios": "expo start --ios",
"web": "expo start --web",
"lint": "expo lint",
"build:apk": "eas build --platform android --profile preview --local"
"build:apk": "eas build --platform android --profile preview --local --non-interactive --output ./calchat.apk"
},
"dependencies": {
"@calchat/shared": "*",
+8
View File
@@ -87,6 +87,14 @@ app.get("/health", (_, res) => {
res.json({ status: "ok" });
});
// Version endpoint
app.get("/version", (_, res) => {
res.json({
version: process.env.VERSION || "unknown",
commit: process.env.COMMIT || "unknown",
});
});
// AI Test endpoint (for development only)
app.post("/api/ai/test", async (req, res) => {
try {
+2 -1
View File
@@ -9,7 +9,8 @@
"./*": "./dist/*"
},
"scripts": {
"build": "tsc"
"build": "tsc",
"prepare": "tsc"
},
"dependencies": {
"rrule": "^2.8.1"