mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-15 20:16:11 +00:00
fix(deploynotify): preserve coolify source commit
This commit is contained in:
1 parent
b0586903f5
commit
9c8387bf3a
5 files changed
+35
-22
No files matched your search
@@ -1,6 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/tiennm99/miti99bot/internal/modules"
|
||||
@@ -29,6 +32,22 @@ func TestResolveCommitSHA(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestComposeDoesNotOverrideSourceCommit(t *testing.T) {
|
||||
b, err := os.ReadFile(filepath.Join("..", "..", "compose.yml"))
|
||||
if err != nil {
|
||||
t.Fatalf("read compose.yml: %v", err)
|
||||
}
|
||||
for _, line := range strings.Split(string(b), "\n") {
|
||||
trimmed := strings.TrimSpace(line)
|
||||
if trimmed == "" || strings.HasPrefix(trimmed, "#") {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(trimmed, "SOURCE_COMMIT:") || strings.HasPrefix(trimmed, "- SOURCE_COMMIT") {
|
||||
t.Fatalf("compose.yml must not declare SOURCE_COMMIT; Coolify supplies it at runtime and an explicit Compose value can override it with empty")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFactoriesIncludesGoldAndCoin(t *testing.T) {
|
||||
catalog := factories()
|
||||
if catalog["gold"] == nil {
|
||||
|
||||
Reference in new issue
Block a user