Commit 17a9a523 authored by Isuru Fernando's avatar Isuru Fernando
Browse files

Update all hooks in conda-forge

parent 396c81e0
from __future__ import print_function
import os
import requests
import ruamel.yaml
import subprocess
from github import Github
circle_token = os.environ["CIRCLE_TOKEN"]
appveyor_token = os.environ["APPVEYOR_TOKEN"]
anaconda_token = os.environ["BINSTAR_TOKEN"]
gh_token = os.environ["GH_TOKEN"]
smithy_conf = os.path.expanduser('~/.conda-smithy')
if not os.path.exists(smithy_conf):
os.mkdir(smithy_conf)
def write_token(name, token):
with open(os.path.join(smithy_conf, name + '.token'), 'w') as fh:
fh.write(token)
if 'APPVEYOR_TOKEN' in os.environ:
write_token('appveyor', os.environ['APPVEYOR_TOKEN'])
if 'CIRCLE_TOKEN' in os.environ:
write_token('circle', os.environ['CIRCLE_TOKEN'])
if 'GH_TOKEN' in os.environ:
write_token('github', os.environ['GH_TOKEN'])
from conda_smithy.ci_register import add_conda_forge_webservice_hooks
if __name__ == '__main__':
owner = 'conda-forge'
gh = Github(gh_token)
org = gh.get_organization(owner)
split_num, no_cases = os.getenv("TEST_SPLIT", "0/1").split("/")
split_num, no_cases = int(split_num), int(no_cases)
i = -1
for feedstock in org.get_repos():
i = i + 1
if i % no_cases != split_num:
continue
print(i, feedstock.name)
if not feedstock.name.endswith('-feedstock'):
continue
repo = feedstock.name
add_conda_forge_webservice_hooks(owner, repo)
......@@ -25,7 +25,7 @@ if [ -n "$GH_TOKEN" ]; then
mkdir -p ~/.conda-smithy && echo $GH_TOKEN > ~/.conda-smithy/github.token
mkdir feedstocks && cd feedstocks
python ../.CI/update_all_tokens.py
python ../.CI/update_all_hooks.py
fi
......@@ -23,12 +23,12 @@ env:
# Add the TRAVIS_TOKEN environment variable for the "conda-forge" Travis user.
- secure: "BBJrw5OcEG4zEUxjXt2txNoz+o7ilTb0e8Tj1626USKqi6HAWOdSFHW7PLYR6vyefWsHnGLAeYMRr9UB56O2oDwS7jgClBKbyut2+Q+8SQBwEtNCMHdU996IzSuDP4AM3h7DLjTsuinWhwpqLu72z2ZjE9OMz4q03SyyiBOecWU1btYbp/u3bpNzyhb2u0HMkRUnS8MxPUa8aHZBKp/JpLrGQmIT0LcjLNp4/jTZp+cs+J//02hAhJHV3vMmyefVvRZayu3xKzutpb3qIga0JAP3d0j2FWXRHVTW6Ke5H4u/4NU7iTpdRjpymnzH7H2kfOrNzgCJ23NfNhScDJDc5URvdXlstgkC4lDkd7BbSVgKKaVy2vVcMkz98qbBnhi0akMHNZXPLvT9tec9AsAX5/pdNaa1rH/iRhjWRfTCnqODX+RTwMhA1/3rkmhzI/8JFCcaZet8+lA2LtOf95jGmwcRwPlNFX0Jdd1QBk2nUAUpCePWIdg7GRxYuO7a4QCbhc6bSyB/WrCQZ1oEmtwGSRqxpMKvQmjxJObg40MgP0DaquGov30A4QLoEdvXCnM7w3QyIr5L/BrLlnCy8LesAZIBn2l5LAHrBFGh9t/lCK9APlUjD9dgT6eCYOSbfdBghKCGsajAsM/fwsPvcjOmpFCLf+UZTer36B57ccHrYdU="
#matrix:
# - TEST_SPLIT=0/5
# - TEST_SPLIT=1/5
# - TEST_SPLIT=2/5
# - TEST_SPLIT=3/5
# - TEST_SPLIT=4/5
matrix:
- TEST_SPLIT=0/5
- TEST_SPLIT=1/5
- TEST_SPLIT=2/5
- TEST_SPLIT=3/5
- TEST_SPLIT=4/5
script:
- git config --global user.name "Travis-CI on github.com/conda-forge/staged-recipes";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment