box: wercker/python
build:
  steps:
    - virtualenv:
        name: Setup virtual environment
    - pip-install:
        name: Install requirements
        auto_run_wheel: True
    - script:
        name: Run unit testing
        code: |
          python setup.py test
deploy:
  steps:
    - add-to-known_hosts:
        hostname: $TARGET_HOST
    - mktemp:
        envvar: PRIVATEKEY_PATH
    - create-file:
        name: write key
        filename: $PRIVATEKEY_PATH
        content: $SSH_KEY_PRIVATE
        overwrite: true
        hide-from-log: true
    - script:
        name: transfer application
        code: |
          scp -r -i $PRIVATEKEY_PATH -o StrictHostKeyChecking=no -o UserKnownHostsFile=no * $TARGET_USER@$TARGET_HOST:dropbot/
    - script:
        name: building virtualenv
        code: ssh -i $PRIVATEKEY_PATH -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $TARGET_HOST virtualenv venv --no-site-packages
    - script:
        name: installing requirements
        code: ssh -i $PRIVATEKEY_PATH -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $TARGET_HOST source venv/bin/activate && cd dropbot/ && pip install -r requirements      

box: wercker/python
build:
  steps:
    - virtualenv:
        name: Setup virtual environment
    - pip-install:
        name: Install requirements
        auto_run_wheel: True
    - script:
        name: Run unit testing
        code: |
          python setup.py test
deploy:
  steps:
    - add-to-known_hosts:
        hostname: $TARGET_HOST
    - mktemp:
        envvar: PRIVATEKEY_PATH
    - create-file:
        name: write key
        filename: $PRIVATEKEY_PATH
        content: $SSH_KEY_PRIVATE
        overwrite: true
        hide-from-log: true
    - script:
        name: transfer application
        code: |
          scp -r -i $PRIVATEKEY_PATH -o StrictHostKeyChecking=no -o UserKnownHostsFile=no * $TARGET_USER@$TARGET_HOST:dropbot/
    - script:
        name: building virtualenv
        code: ssh -i $PRIVATEKEY_PATH -l $TARGET_USER -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $TARGET_HOST virtualenv venv --no-site-packages
    - script:
        name: installing requirements
        code: ssh -i $PRIVATEKEY_PATH -l $TARGET_USER -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $TARGET_HOST source venv/bin/activate && cd dropbot/ && pip install -r requirements      

Fix target user for virtualenv setup.
Fix target user for virtualenv setup.