easybib/dev

EasyBib is an online research management platform used by over 40 million students at thousands of institutions across the United States.

We are revolutionizing how students develop research skills. We believe strong research habits are a cornerstone for creating a better, smarter, and more-informed world.

We were founded 2001, are bootstrapped, profitable, and looking to grow. Interested in working with us? Let us know.
EasyBib is an online research management platform used by over 40 million students at thousands of institutions across the United States.

We are revolutionizing how students develop research skills. We believe strong research habits are a cornerstone for creating a better, smarter, and more-informed world.

We were founded 2001, are bootstrapped, profitable, and looking to grow. Interested in working with us? Let us know.
  • rss
  • archive
  • Composer, Github and Travis-CI

    Composer seems to have become the defacto dependency management tool in the last year. At EasyBib we make heavy use of composer both when we run test suites on Travis-CI and also during deployment.

    Because we use Github to host our code, the most obvious ways to speed up each of these runs is to use Github downloads instead of cloning the code during ./composer.phar install.

    By default composer will attempt this — unless --prefer-source is provided.

    Authentication

    One of the caveats to this is that by default composer will use unauthenticated API calls against the Github API. Github’s API allows only 60 unauthenticated calls an hour but up to 5,000 authenticated calls in the same timespan.

    In an office with six developers it’s easy to burn through these 60 calls. On Travis-CI — due to a lot higher volumes of test runs and customers — it’s even easier.

    The solution is to configure composer to use an OAuth2 key!

    Setup

    There are of course programmatic ways to generate the key using Github’s API.

    But the easiest way is to wait until I exceeded all calls and have composer set it up for me. Once I aquired the key, I made a copy of the ~/.composer/config.json file and backed it up for later.

    The manual steps to set it up are as follows:

     $ mkdir ~/.composer
    $ echo '{ "config": { "github-oauth": { "github.com": "YOUR-KEY" } } }' > ~/.composer/config.json

    On Travis-CI (or anywhere else where automation is required), the same commands can be executed within the before_script in your .travis.yml.

    Careful

    Please note: This method works best on private repositories and the Travis-CI pro setup. The token you specify may or may not give anyone access to your private repositories as well.

    One way to sail around the access limit is to setup a dedicated user on GitHub which has only pull-access to your public repositories. Another is to use the facilities to encrypt the data.

    Fin

    Enjoy!

    • December 18, 2012 (11:15 am)
    • 1 notes
    • #php
    • #composer
    • #deployment
    • #travis-ci
    • #oauth2
    • #github
    • #testing
    1. garotageek likes this
    2. drafts posted this
© 2008–2013 easybib/dev