-
-
Notifications
You must be signed in to change notification settings - Fork 31k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting up CPython repo is now done in the worker app. (GH-34)
Instead of in the main app.
- Loading branch information
Showing
2 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
import os | ||
import subprocess | ||
|
||
from celery import bootsteps | ||
|
||
from cherry_picker import cherry_picker | ||
|
||
from . import util | ||
|
@@ -14,6 +16,7 @@ | |
|
||
@app.task(rate_limit="1/m") | ||
def setup_cpython_repo(): | ||
print("Setting up CPython repository") | ||
if "cpython" not in os.listdir('.'): | ||
subprocess.check_output( | ||
f"git clone https://{os.environ.get('GH_AUTH')}:[email protected]/miss-islington/cpython.git".split()) | ||
|
@@ -64,3 +67,13 @@ def backport_task(commit_hash, branch, *, issue_number, created_by, merged_by): | |
``` | ||
""") | ||
cp.abort_cherry_pick() | ||
|
||
|
||
class InitRepoStep(bootsteps.StartStopStep): | ||
|
||
def start(self, c): | ||
print("Initialize the repository.") | ||
setup_cpython_repo() | ||
|
||
|
||
app.steps['worker'].add(InitRepoStep) |