machine:
  services:
    - docker

general:
  artifacts:
    - "dist/avame-0.1.0+${CIRCLE_BUILD_NUM}.tgz"

dependencies:
  override:
    - sudo mkdir -p /usr/local/lib
    - sudo pip install -U pip
    - sudo easy_install -U setuptools
    - pip install -r requirements.txt
    - pip install selenium
    - pip install coveralls

test:
  override:
    - sudo cp libs/libsodium.so.13.1.0 /usr/local/lib/
    - sudo ln -s /usr/local/lib/libsodium.so.13.1.0 /usr/local/lib/libsodium.so.13
    - sudo ln -s /usr/local/lib/libsodium.so.13.1.0 /usr/local/lib/libsodium.so
    - jasmine-ci
    - doit all_tests
    - doit pack_tui
  post:
    - coveralls
    - cd dist && tar zcvf avame-0.1.0+${CIRCLE_BUILD_NUM}.tgz avame/

deployment:
  hub:
    branch: master
    commands:
      - docker build -t eavatar/avame:$CIRCLE_BUILD_NUM-$CIRCLE_SHA1 .
      - docker tag eavatar/avame:$CIRCLE_BUILD_NUM-$CIRCLE_SHA1 eavatar/avame:latest
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push eavatar/avame

machine:
  services:
    - docker

general:
  artifacts:
    - "dist/avame-0.1.0+${CIRCLE_BUILD_NUM}.tgz"

dependencies:
  override:
    - sudo mkdir -p /usr/local/lib
    - sudo pip install -U pip
    - sudo easy_install -U setuptools
    - pip install -r requirements.txt
    - pip install selenium
    - pip install coveralls

test:
  override:
    - sudo cp libs/libsodium.so.13.1.0 /usr/local/lib/
    - sudo ln -s /usr/local/lib/libsodium.so.13.1.0 /usr/local/lib/libsodium.so.13
    - sudo ln -s /usr/local/lib/libsodium.so.13.1.0 /usr/local/lib/libsodium.so
    - jasmine-ci
    - doit all_tests
    - doit pack_tui
  post:
    - coveralls
    - cd dist && tar zcvf avame-0.1.0+${CIRCLE_BUILD_NUM}.tgz avame/

deployment:
  hub:
    branch: master
    commands:
      - docker build -t eavatar/avame:$CIRCLE_BUILD_NUM-$CIRCLE_SHA1 .
      - docker tag eavatar/avame:$CIRCLE_BUILD_NUM-$CIRCLE_SHA1 eavatar/avame:latest
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push eavatar/avame
      - curl -X POST --form "key=${DEPLOY_KEY}" http://teamhub.eavatar.com:7080/deploy-avame

Add command to deploy new image to the testing environment
Add command to deploy new image to the testing environment
