Compare commits

..

1 Commits

Author SHA1 Message Date
0ef51e7ccf fix: latest commit for new recipe version
All checks were successful
continuous-integration/drone/push Build is passing
See #527
2025-04-14 11:38:07 +02:00
6 changed files with 16 additions and 41 deletions

View File

@ -143,13 +143,9 @@ Use "--status/-S" flag to query all servers for the live deployment status.`,
var newUpdates []string
if version != "unknown" {
if err := app.Recipe.EnsureExists(); err != nil {
log.Fatalf("unable to clone %s: %s", app.Name, err)
}
updates, err := app.Recipe.Tags()
if err != nil {
log.Fatalf("unable to retrieve tags for %s: %s", app.Name, err)
log.Fatal(err)
}
parsedVersion, err := tagcmp.Parse(version)

View File

@ -109,15 +109,6 @@ var AppNewCommand = &cobra.Command{
if err := recipe.EnsureLatest(); err != nil {
log.Fatal(err)
}
if recipeVersion == "" {
head, err := recipe.Head()
if err != nil {
log.Fatalf("failed to retrieve latest commit for %s: %s", recipe.Name, err)
}
recipeVersion = formatter.SmallSHA(head.String())
}
}
}
@ -194,6 +185,15 @@ var AppNewCommand = &cobra.Command{
newAppServer = "local"
}
if recipeVersion == "" {
head, err := recipe.Head()
if err != nil {
log.Fatalf("failed to retrieve latest commit for %s: %s", recipe.Name, err)
}
recipeVersion = formatter.SmallSHA(head.String())
}
log.Infof("%s created (version: %s)", appDomain, recipeVersion)
if len(appSecrets) > 0 {

View File

@ -25,7 +25,7 @@ func gitCloneIgnoreErr(err error) bool {
// Clone runs a git clone which accounts for different default branches.
func Clone(dir, url string) error {
if _, err := os.Stat(dir); os.IsNotExist(err) {
log.Debugf("git clone: %s", url)
log.Debugf("git clone: %s", dir, url)
_, err := git.PlainClone(dir, false, &git.CloneOptions{
URL: url,

View File

@ -15,10 +15,8 @@ import (
"github.com/go-git/go-git/v5/plumbing"
)
var (
Warn = "warn"
Critical = "critical"
)
var Warn = "warn"
var Critical = "critical"
type LintFunction func(recipe.Recipe) (bool, error)
@ -196,7 +194,7 @@ func LintForErrors(recipe recipe.Recipe) error {
ok, err := rule.Function(recipe)
if err != nil {
return fmt.Errorf("lint %s: %s", rule.Ref, err)
return err
}
if !ok {
return fmt.Errorf("lint error in %s configs: \"%s\" failed lint checks (%s)", recipe.Name, rule.Description, rule.Ref)

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash
ABRA_VERSION="0.10.0-beta"
ABRA_VERSION="0.9.0-beta"
ABRA_RELEASE_URL="https://git.coopcloud.tech/api/v1/repos/toolshed/abra/releases/tags/$ABRA_VERSION"
RC_VERSION="0.10.0-beta"
RC_VERSION="0.10.0-rc2-beta"
RC_VERSION_URL="https://git.coopcloud.tech/api/v1/repos/toolshed/abra/releases/tags/$RC_VERSION"
for arg in "$@"; do

View File

@ -8,7 +8,6 @@ setup_file(){
}
teardown_file(){
_undeploy_app
_rm_app
_rm_server
}
@ -88,10 +87,6 @@ teardown(){
assert_success
refute_output --partial "$TEST_RECIPE"
assert_output --partial "foo-recipe"
run rm -rf "$ABRA_DIR/servers/foo.com"
assert_success
assert_not_exists "$ABRA_DIR/servers/foo.com"
}
@test "output is machine readable" {
@ -103,17 +98,3 @@ teardown(){
assert_output --partial "$expectedOutput"
}
# bats test_tags=slow
@test "list with status fetches recipe" {
_deploy_app
run $ABRA app ls --status
assert_success
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
assert_success
run $ABRA app ls --status
assert_success
}