Add TrueNAS compose, separate DB volume, and release script
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
7716f8c297
commit
7df53679cb
3 files changed
+41
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
# 用法:.\release.ps1
|
||||
# 從 config.py 讀版本號 → build image → 推到 gitea registry → 打 git tag
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$Image = "gitea.sthkm3.org/sthkm3/discordgamebot"
|
||||
$Version = (Select-String -Path config.py -Pattern 'VERSION = "V?([^"]+)"').Matches[0].Groups[1].Value
|
||||
|
||||
if (git status --porcelain) {
|
||||
throw "有未 commit 的修改,請先 commit 再發布"
|
||||
}
|
||||
if (git tag --list "v$Version") {
|
||||
throw "v$Version 已經發布過了,請先更新 config.py 的 VERSION"
|
||||
}
|
||||
|
||||
docker build -t "${Image}:$Version" -t "${Image}:latest" .
|
||||
if ($LASTEXITCODE) { throw "docker build 失敗" }
|
||||
docker push "${Image}:$Version"
|
||||
if ($LASTEXITCODE) { throw "docker push 失敗" }
|
||||
docker push "${Image}:latest"
|
||||
if ($LASTEXITCODE) { throw "docker push 失敗" }
|
||||
|
||||
git tag "v$Version"
|
||||
git push origin "v$Version"
|
||||
|
||||
Write-Host "已發布 ${Image}:$Version"
|
||||
Reference in new issue
Block a user