language: python

env:
  global:
    - VERSION='3.5-dev-python-org'
    - ALIAS='3.5.0-dev'
    - INSTALL_DEST=/opt/python
    - PACKAGES='pip numpy nose pytest mock wheel'

install:
  - true

script:
  - pushd $HOME
  - sudo env PYTHON_BUILD_ROOT=$TRAVIS_BUILD_DIR python-build $VERSION $INSTALL_DEST/$ALIAS
  - sudo ln -s $INSTALL_DEST/$VERSION $INSTALL_DEST/$ALIAS
  - virtualenv --distribute --python=$INSTALL_DEST/$VERSION/bin/python /home/travis/virtualenv/python$VERSION
  - ln -s $HOME/virtualenv/python$VERSION $HOME/virtualenv/python$ALIAS
  - $HOME/virtualenv/python$VERSION/bin/pip install --upgrade $PACKAGES
  - popd

after_success:
  - mkdir $HOME/archive
  - tar cjf $HOME/archive/python-$ALIAS.tar.bz2 $INSTALL_DEST/$VERSION $INSTALL_DEST/$ALIAS $HOME/virtualenv/python$VERSION $HOME/virtualenv/python$ALIAS
  - ls -lh $HOME/archive/python-$ALIAS.tar.bz2

deploy:
  provider: s3
  access_key_id: $ARTIFACTS_KEY
  secret_access_key: $ARTIFACTS_SECRET
  bucket: $ARTIFACTS_BUCKET
  local_dir: $HOME/archive

language: python

env:
  global:
    - VERSION='3.5-dev-python-org'
    - ALIAS='3.5.0-dev'
    - INSTALL_DEST=/opt/python
    - PACKAGES='pip numpy nose pytest mock wheel'

install:
  - true

script:
  - pushd $HOME
  - sudo env PYTHON_BUILD_DEFINITIONS=$TRAVIS_BUILD_DIR python-build $VERSION $INSTALL_DEST/$ALIAS
  - sudo ln -s $INSTALL_DEST/$VERSION $INSTALL_DEST/$ALIAS
  - virtualenv --distribute --python=$INSTALL_DEST/$VERSION/bin/python /home/travis/virtualenv/python$VERSION
  - ln -s $HOME/virtualenv/python$VERSION $HOME/virtualenv/python$ALIAS
  - $HOME/virtualenv/python$VERSION/bin/pip install --upgrade $PACKAGES
  - popd

after_success:
  - mkdir $HOME/archive
  - tar cjf $HOME/archive/python-$ALIAS.tar.bz2 $INSTALL_DEST/$VERSION $INSTALL_DEST/$ALIAS $HOME/virtualenv/python$VERSION $HOME/virtualenv/python$ALIAS
  - ls -lh $HOME/archive/python-$ALIAS.tar.bz2

deploy:
  provider: s3
  access_key_id: $ARTIFACTS_KEY
  secret_access_key: $ARTIFACTS_SECRET
  bucket: $ARTIFACTS_BUCKET
  local_dir: $HOME/archive

Set PYTHON_BUILD_DEFINITIONS to locate custom def file
Set PYTHON_BUILD_DEFINITIONS to locate custom def file
