126 lines
2.9 KiB
Markdown
126 lines
2.9 KiB
Markdown
# Soleprint Room Configurations
|
|
|
|
Private repository containing room-specific configurations for Soleprint instances.
|
|
|
|
## Structure
|
|
|
|
```
|
|
cfg/
|
|
├── amar/ # Amar managed room
|
|
│ ├── config.json
|
|
│ ├── data/
|
|
│ ├── soleprint/ # Soleprint customizations
|
|
│ ├── link/ # Bridge to managed app
|
|
│ └── ctrl/ # Build/run scripts
|
|
├── dlt/ # DLT placeholder room
|
|
└── README.md
|
|
```
|
|
|
|
## Setup
|
|
|
|
This repo lives inside the main soleprint repo at `cfg/`. The `standalone/` folder is tracked in the main soleprint repo as a sample.
|
|
|
|
### Fresh clone (new machine)
|
|
|
|
```bash
|
|
# Clone main soleprint repo
|
|
git clone <soleprint-repo-url> spr
|
|
cd spr
|
|
|
|
# Clone this cfg repo into cfg/ (standalone/ already exists from main repo)
|
|
git clone <this-cfg-repo-url> cfg-private
|
|
mv cfg-private/.git cfg/
|
|
mv cfg-private/* cfg/ 2>/dev/null
|
|
rm -rf cfg-private
|
|
|
|
# Now cfg/ has both:
|
|
# - standalone/ (from main soleprint repo)
|
|
# - amar/, dlt/ (from this cfg repo)
|
|
```
|
|
|
|
### Alternative: Separate directories
|
|
|
|
```bash
|
|
# Keep repos separate, use --cfg-path
|
|
git clone <soleprint-repo-url> spr
|
|
git clone <this-cfg-repo-url> spr-cfg
|
|
|
|
# Build with external cfg path
|
|
cd spr
|
|
python build.py --cfg amar --cfg-path ../spr-cfg
|
|
```
|
|
|
|
## Building
|
|
|
|
From the main soleprint repo:
|
|
|
|
```bash
|
|
python build.py # Build standalone (sample)
|
|
python build.py --cfg amar # Build amar room
|
|
python build.py --cfg dlt # Build dlt room
|
|
```
|
|
|
|
## Deploy/Sync Workflow
|
|
|
|
### Local Development
|
|
|
|
```bash
|
|
# 1. Build the room
|
|
python build.py --cfg amar
|
|
|
|
# 2. Start with Docker
|
|
cd gen/amar/soleprint && docker compose up -d
|
|
|
|
# 3. For managed rooms, also start the app
|
|
cd gen/amar/amar && docker compose up -d
|
|
```
|
|
|
|
### Production Deploy
|
|
|
|
```bash
|
|
# On deploy server:
|
|
|
|
# 1. Pull both repos
|
|
cd /opt/spr && git pull
|
|
cd /opt/spr/cfg && git pull
|
|
|
|
# 2. Rebuild
|
|
python build.py --cfg amar
|
|
|
|
# 3. Restart services
|
|
cd gen/amar/soleprint && docker compose up -d --build
|
|
```
|
|
|
|
### CI/CD Pipeline (example)
|
|
|
|
```yaml
|
|
# Deploy soleprint changes
|
|
deploy-soleprint:
|
|
script:
|
|
- ssh deploy@server "cd /opt/spr && git pull && python build.py --cfg amar"
|
|
- ssh deploy@server "cd /opt/spr/gen/amar/soleprint && docker compose up -d --build"
|
|
|
|
# Deploy cfg changes (private repo)
|
|
deploy-cfg:
|
|
script:
|
|
- ssh deploy@server "cd /opt/spr/cfg && git pull && python ../build.py --cfg amar"
|
|
- ssh deploy@server "cd /opt/spr/gen/amar/soleprint && docker compose up -d --build"
|
|
```
|
|
|
|
## Credentials
|
|
|
|
- `.env` files are gitignored - copy from `.env.example`
|
|
- Never commit actual credentials
|
|
- Database dumps in `*/dumps/` are also gitignored
|
|
|
|
## Adding a New Room
|
|
|
|
```bash
|
|
# From cfg/ directory
|
|
mkdir -p newroom/data newroom/soleprint
|
|
cp ../cfg/standalone/config.json newroom/ # Use standalone as template
|
|
# Edit config.json for your room
|
|
# Add room-specific customizations in newroom/soleprint/
|
|
git add newroom && git commit -m "Add newroom configuration"
|
|
```
|