Skip to content

Commit

Permalink
Create a new branch from origin
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek committed Nov 6, 2024
1 parent 9f55a13 commit 4427712
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
dockerfiles: ./Dockerfile
image: betka
tags: latest 1 ${{ github.sha }} 0.9.3
tags: latest 1 ${{ github.sha }} 0.9.4

- name: Push betka image to Quay.io
id: push-to-quay
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/fedora/fedora:37

ENV NAME=betka-fedora \
RELEASE=0.9.3 \
RELEASE=0.9.4 \
ARCH=x86_64 \
SUMMARY="Syncs changes from upstream repository to downstream" \
DESCRIPTION="Syncs changes from upstream repository to downstream" \
Expand Down
11 changes: 8 additions & 3 deletions betka/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def prepare_downstream_git(self, project_info: ProjectInfo) -> bool:
self.downstream_dir = Git.clone_repo(
project_info.ssh_url_to_repo, self.betka_tmp_dir.name
)
self.info("Downstream directory %r", self.downstream_dir)
self.info(f"Downstream directory {self.downstream_dir}")
if self.downstream_dir is None:
self.error("!!!! Cloning downstream repo %s FAILED.", self.image)
return False
Expand Down Expand Up @@ -571,7 +571,6 @@ def _copy_cloned_downstream_dir(self):
)

def _get_bot_cfg(self, branch: str) -> bool:
Git.call_git_cmd(f"checkout {branch}", msg="Change downstream branch")
self.debug(f"Config before getting bot-cfg.yaml {self.config}")
self.config = self.gitlab_api.get_bot_cfg_yaml(branch=branch)
self.debug(f"Downstream 'bot-cfg.yml' file {self.config}.")
Expand Down Expand Up @@ -659,9 +658,15 @@ def _sync_valid_branches(self, valid_branches):
if self.is_fork_enabled():
self.downstream_git_branch = branch
self.downstream_git_origin_branch = ""
Git.call_git_cmd(f"checkout {branch}", msg="Change downstream branch")
else:
self.downstream_git_branch = f"betka-{branch}"
self.downstream_git_branch = f"betka-{datetime.now().strftime('%Y%m%d%H%M%S')}{branch}"
self.downstream_git_origin_branch = branch
Git.call_git_cmd(
f"checkout -b {self.downstream_git_branch} {branch}",
msg="Create a new downstream branch"
)

# This loads downstream bot-cfg.yml file
# and update betka's dictionary (self.config).
# We need to have information up to date
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_requirements():

setup(
name="betka",
version="0.9.3",
version="0.9.4",
packages=find_packages(exclude=["examples", "tests"]),
url="https://github.com/sclorg/betka",
license="GPLv3+",
Expand Down

0 comments on commit 4427712

Please sign in to comment.