fix: deploy fresh recipe without versions
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

See coop-cloud/organising#476
This commit is contained in:
decentral1se 2023-08-01 21:47:34 +02:00
parent 2cd453ae8d
commit 8bb98ed0ed
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 3 additions and 1 deletions

View File

@ -93,6 +93,7 @@ recipes.
}
}
isLatestHash := false
version := deployedVersion
if version == "unknown" && !internal.Chaos {
catl, err := recipe.ReadRecipeCatalogue(conf)
@ -114,6 +115,7 @@ recipes.
if err != nil {
logrus.Fatal(err)
}
isLatestHash = true
version = formatter.SmallSHA(head.String())
logrus.Warn("no versions detected, using latest commit")
if err := recipe.EnsureLatest(app.Recipe, conf); err != nil {
@ -129,7 +131,7 @@ recipes.
}
}
if version != "unknown" && !internal.Chaos {
if version != "unknown" && !internal.Chaos && !isLatestHash {
if err := recipe.EnsureVersion(app.Recipe, version); err != nil {
logrus.Fatal(err)
}