Skip to content

Commit

Permalink
commit: Add commit
Browse files Browse the repository at this point in the history
Signed-off-by: Arisu Tachibana <[email protected]>
  • Loading branch information
aliceinwire committed Sep 10, 2024
1 parent bc22cb6 commit 6b24798
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kci-dev/subcommands/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@ def api_connection(host):
def find_diff(path, branch, repository):
repo = Repo(path)
assert not repo.bare
for ref in repo.references:
if ref.name != branch:
print("Branch name: "+ ref.name)
sys.exit(0)
hcommit = repo.iter_commits("origin/master.." + branch)
commits = []
for i in hcommit:
commits.append(repo.git.show(i))
return commits


def send_build(url, patch, branch, treeurl, token):
def send_build(url, patch, branch, treeurl, commit, token):
headers = {
"Content-Type": "application/json; charset=utf-8",
"Authorization": "Bearer {}".format(token),
}
values = {
"treeurl": treeurl,
"branch": branch,
"commit": "example",
"commit": commit,
"kbuildname": "example",
"testname": "example",
}
Expand Down Expand Up @@ -69,7 +73,7 @@ def commit(repository, branch, private, path, settings):
config = load_toml(settings)
url = api_connection(config["connection"]["host"])
diff = find_diff(path, branch, repository)
send_build(url, diff, branch, repository, config["connection"]["token"])
send_build(url, diff, branch, repository, "commit id example", config["connection"]["token"])


if __name__ == "__main__":
Expand Down

0 comments on commit 6b24798

Please sign in to comment.