From 1ba571b7026e5d14cb67e0fb7237ad64f33ec9bf Mon Sep 17 00:00:00 2001 From: rudolf1 Date: Tue, 23 Sep 2025 22:01:38 +0200 Subject: [PATCH] Problem ref head (#15) --- backend/app.py | 2 +- backend/steps/docker.py | 3 ++- backend/steps/git.py | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app.py b/backend/app.py index 00d3cba..2261575 100644 --- a/backend/app.py +++ b/backend/app.py @@ -175,7 +175,7 @@ if __name__ == '__main__': if not isinstance(step, GitClone): continue branches[env.id] = {**step.get_branches()} - # print(f"Delete check {env.branches} after {[x for x in env.branches if x[0] in branches[env.id].keys()]}") + # logger.info(f"Delete check {env.branches} after {[x for x in env.branches if x[0] in branches[env.id].keys()]}") env.branches = [x for x in env.branches if x[0] in branches[env.id].keys()] except BaseException as e: socketio.emit('error', {'message': e}, namespace='/ws/errors') diff --git a/backend/steps/docker.py b/backend/steps/docker.py index 7c82e66..ea08a2d 100644 --- a/backend/steps/docker.py +++ b/backend/steps/docker.py @@ -173,7 +173,7 @@ class DockerSwarmDeploy(AbstractStep[str]): a[k] = v del env["version"] merge_dicts(compose, env) - # print(f"Final compose: {compose}") +# logger.info(f"Final compose: {compose}") content = yaml.safe_dump(compose) current_services = self.stackChecker.result @@ -213,6 +213,7 @@ class DockerSwarmDeploy(AbstractStep[str]): # Deploy stack to Docker Swarm cmd = [ "docker", "stack", "deploy", + "--prune", "-c", tmp_compose_path, self.stack_name ] diff --git a/backend/steps/git.py b/backend/steps/git.py index 2a4db84..99820ed 100644 --- a/backend/steps/git.py +++ b/backend/steps/git.py @@ -188,7 +188,6 @@ class CheckoutMerged(AbstractStep[CheckoutAndMergeResult]): return CheckoutAndMergeResult(auto_branch_name, auto_branch_hash, version) - repo.git.checkout(repo.head.commit.hexsha) if auto_branch_name in repo.branches: repo.git.branch('-D', auto_branch_name) # Auto branch doesn't exist, create it @@ -196,7 +195,7 @@ class CheckoutMerged(AbstractStep[CheckoutAndMergeResult]): commits = list(commit_ids.keys()) repo.git.branch('-f', auto_branch_name, commits[0].hexsha) - repo.git.checkout(auto_branch_name) + repo.git.checkout(commits[0].hexsha) # Merge the rest of the branches for commit in commits[1:]: