allow to define remote branches as recipe source
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
stevensting 2024-12-26 17:55:35 +01:00
parent 04aec8232f
commit 161f2127d6
2 changed files with 6 additions and 4 deletions

View File

@ -95,6 +95,7 @@ func (r Recipe) GetVersionLabelLocal() (string, error) {
for _, service := range config.Services {
for label, value := range service.Deploy.Labels {
log.Debugf("checking deploy label '%s'", label)
if strings.HasPrefix(label, "coop-cloud") && strings.Contains(label, "version") {
return value, nil
}

View File

@ -68,6 +68,7 @@ func (r Recipe) EnsureExists() error {
// EnsureVersion checks whether a specific version exists for a recipe.
func (r Recipe) EnsureVersion(version string) (bool, error) {
isChaosCommit := false
log.Debugf("Ensuring version '%s'", version)
if err := gitPkg.EnsureGitRepo(r.Dir); err != nil {
return isChaosCommit, err
@ -78,7 +79,7 @@ func (r Recipe) EnsureVersion(version string) (bool, error) {
return isChaosCommit, err
}
tags, err := repo.Tags()
tags, err := repo.References()
if err != nil {
return isChaosCommit, err
}
@ -117,11 +118,11 @@ func (r Recipe) EnsureVersion(version string) (bool, error) {
worktree, err := repo.Worktree()
if err != nil {
return isChaosCommit, nil
return isChaosCommit, err
}
if err := worktree.Checkout(opts); err != nil {
return isChaosCommit, nil
return isChaosCommit, err
}
log.Debugf("successfully checked %s out to %s in %s", r.Name, tagRef.Short(), r.Dir)
@ -216,7 +217,7 @@ func (r Recipe) EnsureUpToDate() error {
opts := &git.PullOptions{
Force: true,
ReferenceName: branch,
SingleBranch: true,
SingleBranch: false,
}
if err := worktree.Pull(opts); err != nil {