box: wercker/php
build:
  steps:
    - script:
        name: setup log and cache folder
        code: sudo mkdir /var/log/phpdoc.org; sudo chmod 777 /var/log/phpdoc.org; sudo mkdir /tmp/phpdoc.org; sudo chmod 777 /tmp/phpdoc.org
    - script:
        name: install dependencies
        code: |-
            composer install --no-interaction
    - script:
        name: unit tests
        code: phpunit --configuration app/

deploy:
  steps:
    - script:
        name: Update apt
        code: sudo apt-get update
    - script:
        name: install python pip
        code: sudo apt-get install python-pip
    - script:
        name: install ansible
        code: sudo pip install ansible
    - add-to-known_hosts:
        hostname: staging.phpdoc.org
    - add-to-known_hosts:
        hostname: phpdoc.org
    - mktemp:
        envvar: PRIVATEKEY_PATH
    - create-file:
        name: Write private key to file
        filename: $PRIVATEKEY_PATH
        content: $DEPLOY_KEY_PRIVATE
        overwrite: true
        hide-from-log: true
    - mktemp:
        envvar: INVENTORY_PATH
    - create-file:
        name: Generate ansible inventory
        filename: $INVENTORY_PATH
        content: $HOSTS
        overwrite: true
        hide-from-log: true
    - script:
        name: Run ansible
        code: ansible-playbook ansible/playbook.yml -i $INVENTORY_PATH -u mvriel --private-key=$PRIVATEKEY_PATH --extra-vars "project_dir=$WERCKER_SOURCE_DIR releases_dir=$RELEASES_DIR"

box: wercker/php
build:
  steps:
    - script:
        name: setup log and cache folder
        code: sudo mkdir /var/log/phpdoc.org; sudo chmod 777 /var/log/phpdoc.org; sudo mkdir /tmp/phpdoc.org; sudo chmod 777 /tmp/phpdoc.org
    - script:
        name: install dependencies
        code: |-
            composer install --no-interaction
    - script:
        name: unit tests
        code: phpunit --configuration app/

deploy:
  steps:
    - script:
        name: Update apt
        code: sudo apt-get update
    - script:
        name: install python pip
        code: sudo apt-get install setuptools python-pip
    - script:
        name: install sphinx-doc
        code: sudo easy_install -U sphinx
    - script:
        name: install ansible
        code: sudo pip install ansible
    - add-to-known_hosts:
        hostname: staging.phpdoc.org
    - add-to-known_hosts:
        hostname: phpdoc.org
    - wercker/add-ssh-key:
        keyname: DEPLOY_KEY
    - mktemp:
        envvar: INVENTORY_PATH
    - create-file:
        name: Generate ansible inventory
        filename: $INVENTORY_PATH
        content: $HOSTS
        overwrite: true
        hide-from-log: true
    - script:
        name: Run ansible
        code: ansible-playbook ansible/playbook.yml -i $INVENTORY_PATH -u mvriel --private-key=$PRIVATEKEY_PATH --extra-vars "project_dir=$WERCKER_SOURCE_DIR releases_dir=$RELEASES_DIR"

Add installation of Sphinx on deployment
Add installation of Sphinx on deployment
