diff --git a/CHANGELOG.md b/CHANGELOG.md index e1b67f1..f924265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.24 - 2026-07-12 + +- Fixed the hosted deploy script to use a separate `dist-hosted` output, user-writable remote runtime paths, reliable WSL path conversion, explicit rsync/PM2 failure checks, and rsynced deploy metadata. + ## 0.1.23 - 2026-07-12 - Added the hosted web build path for the private online alpha. diff --git a/package-lock.json b/package-lock.json index 2ec6ab9..529a9ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "libre-study", - "version": "0.1.23", + "version": "0.1.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "libre-study", - "version": "0.1.23", + "version": "0.1.24", "dependencies": { "@tauri-apps/api": "^2.11.1", "react": "^19.2.7", diff --git a/package.json b/package.json index 513a04b..4db7fb8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "libre-study", "private": true, - "version": "0.1.23", + "version": "0.1.24", "type": "module", "scripts": { "dev": "vite --host 127.0.0.1", diff --git a/scripts/deploy-web.ps1 b/scripts/deploy-web.ps1 index 9d830c2..8ec9566 100644 --- a/scripts/deploy-web.ps1 +++ b/scripts/deploy-web.ps1 @@ -1,16 +1,21 @@ param( [string]$HostName = "christunscripted", - [string]$RemoteRoot = "/sites/libre-study", - [string]$RemoteBibleDataRoot = "/sites/libre-bible-data/packages/json", + [string]$RemoteRoot = "/home/jbird/libre-study", + [string]$RemoteBibleDataRoot = "/home/jbird/libre-bible-data/packages/json", [int]$Port = 9174 ) $ErrorActionPreference = "Stop" +function ConvertTo-WslPath([string]$Path) { + $resolved = (Resolve-Path $Path).Path.Replace("\", "/") + return (wsl wslpath -a "$resolved").Trim() +} + $repoRoot = Split-Path -Parent $PSScriptRoot $dataRepo = Resolve-Path (Join-Path $repoRoot "..\libre-bible-data") -$repoRootWsl = (wsl wslpath -a "$repoRoot").Trim() -$dataRepoWsl = (wsl wslpath -a "$dataRepo").Trim() +$repoRootWsl = ConvertTo-WslPath $repoRoot +$dataRepoWsl = ConvertTo-WslPath $dataRepo $commit = (git -C $repoRoot rev-parse HEAD).Trim() $deployedAt = (Get-Date).ToUniversalTime().ToString("o") @@ -33,12 +38,20 @@ $deployInfo = @{ deployedAt = $deployedAt source = "libre-study" } | ConvertTo-Json -Compress +$deployInfoPath = Join-Path $env:TEMP "libre-study-deploy-info.json" +Set-Content -Path $deployInfoPath -Value $deployInfo -NoNewline +$deployInfoPathWsl = ConvertTo-WslPath $deployInfoPath -$escapedDeployInfo = $deployInfo.Replace("'", "'\''") -wsl ssh $HostName "mkdir -p '$RemoteRoot/app' '$RemoteRoot/server' '$RemoteRoot/state' '$RemoteBibleDataRoot' && printf '%s' '$escapedDeployInfo' > '$RemoteRoot/deploy-info.json'" +wsl ssh $HostName "mkdir -p '$RemoteRoot/app' '$RemoteRoot/server' '$RemoteRoot/state' '$RemoteBibleDataRoot'" +if ($LASTEXITCODE -ne 0) { throw "Remote directory preparation failed." } +wsl rsync -az "$deployInfoPathWsl" "${HostName}:$RemoteRoot/deploy-info.json" +if ($LASTEXITCODE -ne 0) { throw "Deploy info rsync failed." } wsl rsync -az --delete "$repoRootWsl/dist-hosted/" "${HostName}:$RemoteRoot/app/" +if ($LASTEXITCODE -ne 0) { throw "App rsync failed." } wsl rsync -az --delete "$repoRootWsl/server/" "${HostName}:$RemoteRoot/server/" +if ($LASTEXITCODE -ne 0) { throw "Server rsync failed." } wsl rsync -az --delete "$dataRepoWsl/packages/json/" "${HostName}:$RemoteBibleDataRoot/" +if ($LASTEXITCODE -ne 0) { throw "LibreBible rsync failed." } $pm2Command = @" cd '$RemoteRoot' && @@ -51,4 +64,6 @@ pm2 save "@ wsl ssh $HostName $pm2Command -Write-Output "Deployed Libre Study web commit $commit to $HostName:$RemoteRoot on port $Port." +if ($LASTEXITCODE -ne 0) { throw "PM2 start/restart failed." } +Remove-Item $deployInfoPath -Force -ErrorAction SilentlyContinue +Write-Output "Deployed Libre Study web commit $commit to ${HostName}:$RemoteRoot on port $Port." diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a059cfb..8cbf402 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -77,7 +77,7 @@ checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "app" -version = "0.1.23" +version = "0.1.24" dependencies = [ "log", "rusqlite", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 9c04b2e..979703d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.1.23" +version = "0.1.24" description = "A Tauri App" authors = ["you"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a3b9f0f..9d83798 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "Libre Study", - "version": "0.1.23", + "version": "0.1.24", "identifier": "org.librestudy.desktop", "build": { "frontendDist": "../dist",