feat: add multi-arch image publishing
This commit is contained in:
@@ -32,7 +32,7 @@ func (a *App) api(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
a.mu.RUnlock()
|
||||
jsonOut(w, 200, map[string]any{"initialized": a.store.Initialized(), "version": "0.2.0", "appServer": connected})
|
||||
jsonOut(w, 200, map[string]any{"initialized": a.store.Initialized(), "version": Version, "appServer": connected})
|
||||
return
|
||||
}
|
||||
if p == "setup" && r.Method == "POST" {
|
||||
|
||||
@@ -25,6 +25,9 @@ import (
|
||||
webassets "codex-helper/internal/web"
|
||||
)
|
||||
|
||||
// Version is overridden at build time for release images.
|
||||
var Version = "0.2.0"
|
||||
|
||||
type App struct {
|
||||
dataDir string
|
||||
store *store.Store
|
||||
|
||||
@@ -23,6 +23,28 @@ func TestSystemStatusRejectsNonGETMethods(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystemStatusReturnsBuildVersion(t *testing.T) {
|
||||
a := newReminderTestApp(t)
|
||||
originalVersion := Version
|
||||
Version = "1.2.3-test"
|
||||
t.Cleanup(func() { Version = originalVersion })
|
||||
recorder := httptest.NewRecorder()
|
||||
request := httptest.NewRequest(http.MethodGet, "/api/v1/system/status", nil)
|
||||
a.api(recorder, request)
|
||||
if recorder.Code != http.StatusOK {
|
||||
t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String())
|
||||
}
|
||||
var body struct {
|
||||
Version string `json:"version"`
|
||||
}
|
||||
if err := json.Unmarshal(recorder.Body.Bytes(), &body); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if body.Version != "1.2.3-test" {
|
||||
t.Fatalf("version = %q; want %q", body.Version, "1.2.3-test")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDashboardSerializesNilListsAsEmptyArrays(t *testing.T) {
|
||||
a := newReminderTestApp(t)
|
||||
a.runtimes[1] = &accountRuntime{}
|
||||
|
||||
Reference in New Issue
Block a user