示例#1
0
文件: deploy.py 项目: tonicbupt/ainur
def _register_app(repo_url, commit_id=None):
    project = _get_project(repo_url)
    if commit_id is None:
        commits = gitlab.getrepositorycommits(project['id'], ref_name='master',
                                              page=0, per_page=1)
        if len(commits) == 0:
            raise ValueError('Project %s has no commits' % repo_url)

        commit_id = commits[0]['id']

    appconfig = _get_rev_appyaml(project['id'], commit_id)
    if not appconfig:
        raise ValueError('app.yaml of %s is empty' % repo_url)

    eru.register_app_version(commit_id, repo_url, '', appconfig)
    return appconfig
示例#2
0
文件: deploy.py 项目: tonicbupt/ainur
def _get_project_commits(repo_url):
    project = _get_project(repo_url)
    if not project:
        return []
    return gitlab.getrepositorycommits(project['id'], page=0)