forked from ksdme/org-status
-
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.
Add support to export list of org repo
Add option to export list of org repos into different formats. Closes ksdme#6
- Loading branch information
Showing
4 changed files
with
76 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class RepoListEncoder: | ||
NAME = None | ||
|
||
def convert_repo_list_to_format(self, repos): | ||
raise NotImplementedError() | ||
|
||
|
||
def get_all_supported_encoders(): | ||
from org_status.encoders.gitman import GitManEncoder | ||
|
||
return ( | ||
GitManEncoder, | ||
) |
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,19 @@ | ||
import yaml | ||
from giturlparse import parse | ||
|
||
from org_status.encoders import RepoListEncoder | ||
|
||
|
||
class GitManEncoder(RepoListEncoder): | ||
NAME = 'gitman' | ||
|
||
def convert_repo_list_to_format(self, repos): | ||
yml_data = {'sources': []} | ||
|
||
for repo in repos: | ||
name = parse(repo.repo_url).repo | ||
yml_data['sources'].append({'name': name, | ||
'repo': repo.repo_url, | ||
'rev': 'master'}) | ||
|
||
return yaml.dump(yml_data, default_flow_style=False) |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
git+https://gitlab.com/gitmate/open-source/IGitt.git#egg=IGitt | ||
requests | ||
termcolor | ||
git+https://github.com/nephila/giturlparse |