mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
Auto-determine web/file/tree/commit URLs for gitlab.com
I've come across at least one layer that is now hosted on gitlab.com, so add support in the layer submission/edit form and import_layer.py for automatically determining the other fields for gitlab.com URLs. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
f10c4db361
commit
a82ce59a52
|
@ -49,6 +49,13 @@ def set_vcs_fields(layer, repoval):
|
|||
layer.vcs_web_tree_base_url = 'http://github.com/' + reponame + '/tree/%branch%/'
|
||||
layer.vcs_web_file_base_url = 'http://github.com/' + reponame + '/blob/%branch%/'
|
||||
layer.vcs_web_commit_url = 'http://github.com/' + reponame + '/commit/%hash%'
|
||||
elif 'gitlab.com/' in repoval:
|
||||
reponame = re.sub('^.*gitlab.com/', '', repoval)
|
||||
reponame = re.sub('.git$', '', reponame)
|
||||
layer.vcs_web_url = 'http://gitlab.com/' + reponame
|
||||
layer.vcs_web_tree_base_url = 'http://gitlab.com/' + reponame + '/tree/%branch%/'
|
||||
layer.vcs_web_file_base_url = 'http://gitlab.com/' + reponame + '/blob/%branch%/'
|
||||
layer.vcs_web_commit_url = 'http://gitlab.com/' + reponame + '/commit/%hash%'
|
||||
elif 'bitbucket.org/' in repoval:
|
||||
reponame = re.sub('^.*bitbucket.org/', '', repoval)
|
||||
reponame = re.sub('.git$', '', reponame)
|
||||
|
|
|
@ -216,6 +216,15 @@
|
|||
this.vcs_web_commit_url = 'http://github.com/' + reponame + '/commit/%hash%/'
|
||||
this.vcs_web_type = '(custom)'
|
||||
}
|
||||
else if( repoval.indexOf('gitlab.com/') > -1 ) {
|
||||
reponame = repoval.replace(/^.*gitlab.com\//, '')
|
||||
reponame = reponame.replace(/.git$/, '')
|
||||
this.vcs_web_url = 'http://gitlab.com/' + reponame
|
||||
this.vcs_web_tree_base_url = 'http://gitlab.com/' + reponame + '/tree/%branch%/'
|
||||
this.vcs_web_file_base_url = 'http://gitlab.com/' + reponame + '/blob/%branch%/'
|
||||
this.vcs_web_commit_url = 'http://gitlab.com/' + reponame + '/commit/%hash%/'
|
||||
this.vcs_web_type = '(custom)'
|
||||
}
|
||||
else if( repoval.indexOf('bitbucket.org/') > -1 ) {
|
||||
reponame = repoval.replace(/^.*bitbucket.org\//, '')
|
||||
reponame = reponame.replace(/.git$/, '')
|
||||
|
|
Loading…
Reference in New Issue
Block a user