Compare commits
13 Commits
v1.0
...
758808e4d0
| Author | SHA1 | Date | |
|---|---|---|---|
| 758808e4d0 | |||
| 30d7fd881e | |||
| 9935adbcbd | |||
| 4f5737d27e | |||
| 3492d5bdc8 | |||
| f5ed9a77c3 | |||
| fd896eb380 | |||
| 93077eb39c | |||
| 56af2f25f6 | |||
| f155ff88c8 | |||
| d29b8df9e3 | |||
| ad7d846604 | |||
| 15804a5605 |
+119
-114
@@ -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 -
|
||||
|
||||
@@ -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.
@@ -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": "*",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
"./*": "./dist/*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
"build": "tsc",
|
||||
"prepare": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"rrule": "^2.8.1"
|
||||
|
||||
Reference in New Issue
Block a user