forked from coala/community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gci: Fetch old GCI data from last deploy
The cleansed data can be fetched from the production website if the origin remote is set to be production repository, as it is on pull requests for Travis CI. This does not yet allow branch builds on forks, as their origin will not be the production repository. Related to coala#3
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import requests | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
from community.git import get_deploy_url | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Fetch old GCI data' | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument('output_dir', nargs='?', type=str) | ||
|
||
def handle(self, *args, **options): | ||
output_dir = options.get('output_dir') | ||
|
||
deploy_url = get_deploy_url() | ||
|
||
r = requests.get(deploy_url + '/static/tasks.yaml') | ||
r.raise_for_status() | ||
|
||
with open(os.path.join(output_dir, 'tasks.yaml'), 'w') as f: | ||
yaml.dump(r.content, f) | ||
|
||
r = requests.get(deploy_url + '/static/instances.yaml') | ||
r.raise_for_status() | ||
|
||
with open(os.path.join(output_dir, 'instances.yaml'), 'w') as f: | ||
yaml.dump(r.content, f) |