hmaarrfk / arm-conda-playground

Trying to see how to install conda on arm
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

register the repository with shippable using an API #2

Open hmaarrfk opened 5 years ago

hmaarrfk commented 5 years ago

I can't find in the API how to register the repository.

If anybody can find it, it would be great!

http://docs.shippable.com/platform/api/api-overview/#!/Projects/post_projects_projectId_newBuild

hmaarrfk commented 5 years ago

I'm really not sure if it is possible. It might be a paid feature, or something not implemented.

I'm not sure if it is too much trouble to "add a repository" if we only have to do a few times.

Somebody with access to the conda-forge account with suffiecient permissions will have to do it.

Thought @jakirkham, @jjhelmus

hmaarrfk commented 5 years ago

This is the simple skeleton I have for now,

skeleton to auto-enable registration ```python import requests import os with open(os.path.expanduser('~/.conda-smithy/shippable.token'), 'r') as fh: shippable_token = fh.read().strip() headers = { 'Accept': 'application/json', 'Authorization': 'apiToken ' + shippable_token, } shippable_endpoint = r'https://api.shippable.com' user = 'hmaarrfk' project = 'arm-conda-playground' response = requests.get(shippable_endpoint + '/projects?projectFullNames={}/{}'.format(user, project), headers=headers) if not len(response.json()): print('could not find repository {}/{}'.format(user, project)) repo_data = response.json()[0] if repo_data['enabledBy'] is not None: print('Repository is already enabled') data = {'branch': 'master'} url = shippable_endpoint + '/projects/{}/newBuild'.format(the_id) response = requests.post(url, headers=headers, data=data) print(response.json()) ``` ``` Repository is already enabled {'logType': 'warn', 'methodName': 'projects|triggerNewBuildRequest|projectId:5c1e78ca26342b070056ffe5|_queueRun', 'id': 2000, 'message': 'postRun for :projectId 5c1e78ca26342b070056ffe5 returned error: access denied to route: /runs'} ```

unfortunately, it seems that their free api is restricted as indicated in the section Free User vs Paid User Tokens http://docs.shippable.com/platform/api/api-tokens/

I would be pretty OK being asked to manually enable repositories ONCE every time a new recipe that wants to be build on aarch64/aarch32 is made.

hmaarrfk commented 5 years ago

xref: https://github.com/Shippable/support/issues/1549 xref: http://blog.shippable.com/daisychaining-builds-with-our-new-public-api