Skip to content
Snippets Groups Projects

update install scripts to use our own channel

Merged Amir MOHAMMADI requested to merge newchannel into master
Files
4
+ 18
12
@@ -94,13 +94,15 @@ class Gitlab(object):
pipeline = subprocess.check_output(cmd)
return json.loads(pipeline.decode())
def create_merge_request(self, project_id, source_branch, target_branch, title,
assignee_id='', description='', target_project_id='',
labels='', milestone_id='', remove_source_branch=''):
def create_merge_request(self, project_id, source_branch, target_branch,
title, assignee_id='', description='',
target_project_id='', labels='', milestone_id='',
remove_source_branch=''):
url = "projects/{}/merge_requests?"
url += "&".join(['source_branch={}', 'target_branch={}', 'title={}'])
url += "&".join(['assignee_id={}', 'description={}', 'target_project_id={}',
'labels={}', 'milestone_id={}', 'remove_source_branch={}'])
url += "&".join(['source_branch={}', 'target_branch={}', 'title={}',
'assignee_id={}', 'description={}',
'target_project_id={}', 'labels={}',
'milestone_id={}', 'remove_source_branch={}'])
url = url.format(project_id, source_branch, target_branch, title,
assignee_id, description, target_project_id, labels,
milestone_id, remove_source_branch)
@@ -181,12 +183,15 @@ def main(package, direct_push=False):
f.write(doc)
run_commands(['git', '--no-pager', 'diff'],
['git', 'config', 'user.email', os.environ.get('GITLAB_USER_EMAIL')],
['git', 'config', 'user.name', os.environ.get('GITLAB_USER_ID')],
['git', 'config', 'user.email',
os.environ.get('GITLAB_USER_EMAIL')],
['git', 'config', 'user.name',
os.environ.get('GITLAB_USER_ID')],
['git', 'add', '-A'])
try:
run_commands(['git', 'commit', '-am',
'Update to version {}'.format(stable_version)])
'[{}] Update to version {}'.format(package,
stable_version)])
except ValueError:
print('Feedstock is already uptodate, skipping.')
return
@@ -202,13 +207,14 @@ def main(package, direct_push=False):
'https://github.com/conda-forge/'
'{}-feedstock/commits/master\n\n'.format(package))
else:
subprocess.call(['git', 'remote', 'set-url', 'origin',
'https://idiapbbb:{}@gitlab.idiap.ch/bob/bob.conda.git'.format(os.environ.get('IDIAPBBB_PASS'))])
origin_url = 'https://idiapbbb:{}@gitlab.idiap.ch/bob/bob.conda.git'
origin_url = origin_url.format(os.environ.get('IDIAPBBB_PASS'))
subprocess.call(['git', 'remote', 'set-url', 'origin', origin_url])
run_commands(['git', 'push', '--quiet', '--force', '--set-upstream',
'origin', branch_name])
gitlab = Gitlab(os.environ.get('GITLAB_API_TOKEN'))
project_id = gitlab.get_project('bob.conda')['id']
title = 'Update-to-version-{}'.format(branch_name)
title = 'Update-to-{}'.format(branch_name)
gitlab.create_merge_request(project_id, branch_name, 'master', title,
remove_source_branch='true')
finally:
Loading