Merge pull request #11 from JayFoxRox/sync-master

Sync master branch on PUSH_REPO
This commit is contained in:
James Rowe 2016-11-25 12:33:56 -07:00 committed by GitHub
commit 05ddf3be75
2 changed files with 6 additions and 1 deletions

View File

@ -12,7 +12,8 @@ It is ran on a daily cron-job and updates from this repo before trying to merge
## What does it do? ## What does it do?
After doing the self-update, the bot will visit each of the listed `PULL_REPOS`. After doing the self-update, the bot will clone the latest `MAIN_REPO` and resync `PUSH_REPO`/master.
After that, each of the `PULL_REPOS` is visited.
It will look for PRs on GitHub labelled with `LABEL_TO_FETCH` and merge those onto the `MAIN_REPO`/master branch. It will look for PRs on GitHub labelled with `LABEL_TO_FETCH` and merge those onto the `MAIN_REPO`/master branch.
If a PR fails to merge it will be ignored. If a PR fails to merge it will be ignored.
Once everything has been merged the bot will push the resulting files to the `PUSH_REPO`/`self.branch_name` branch. Once everything has been merged the bot will push the resulting files to the `PUSH_REPO`/`self.branch_name` branch.

View File

@ -154,6 +154,9 @@ class TagMergeBot:
return total_failed return total_failed
def sync(self):
_git("push", "-f", self.push_repo["name"], "master", cwd=self.tracking_path)
def push(self): def push(self):
_git("push", "-f", self.push_repo["name"], self.branch_name, cwd=self.tracking_path) _git("push", "-f", self.push_repo["name"], self.branch_name, cwd=self.tracking_path)
@ -212,6 +215,7 @@ if __name__ == "__main__":
# TODO: Rework this whole workflow to be sane. # TODO: Rework this whole workflow to be sane.
# m = MergeBot(PULL_REPOS, PUSH_REPO) # m = MergeBot(PULL_REPOS, PUSH_REPO)
t.reclone() t.reclone()
t.sync()
t.pull_branches() t.pull_branches()
failed = t.merge() failed = t.merge()
logger.info("Number of failed merges: {failed}".format(failed=failed)) logger.info("Number of failed merges: {failed}".format(failed=failed))