sudo: false
language: node_js
node_js:
- '0.11'
addons:
  code_climate:
    repo_token: e080139b7ac8b55f139f0ddd855fe6ac23a8a773a8b0841b3404441623115fb2
before_script:
- npm install -g codeclimate-test-reporter
after_script:
- codeclimate-test-reporter < coverage/lcov.info
before_deploy:
- npm install browserify@12.0.2 coffeeify@2.0.1
- mkdir -p deploy/meshblu-http/latest
- mkdir -p deploy/meshblu-http/$TRAVIS_TAG
- node_modules/.bin/browserify -s MeshbluHttp -t coffeeify index.coffee > deploy/meshblu-http/latest/meshblu-http.bundle.js
- gzip deploy/meshblu-http/latest/meshblu-http.bundle.js
- mv deploy/meshblu-http/latest/meshblu-http.bundle.js.gz deploy/meshblu-http/latest/meshblu-http.bundle.js
- cp deploy/meshblu-http/latest/meshblu-http.bundle.js deploy/meshblu-http/$TRAVIS_TAG/meshblu-http.bundle.js
deploy:
- provider: s3
  access_key_id: AKIAJH2D5IPIRHYJT5IA
  secret_access_key:
    secure: T1ycqhCu/cXKcLL3CL0/s7APtcgRw0COIXBAgCPA2ISVLWll05ON39Y8/ujGIodXMDSkb7jIuURQSDck0U3SlS/qBI2xycCxnIYEIZrL23VaICSexqTt/L2R4ndg86hRy7U+Qe3fxonKJvIAoO9ws/CVlHbpLhQ5RTzmnxNr4B4=
  bucket: octoblu-cdn
  region: us-west-2
  skip_cleanup: true
  local-dir: deploy
  detect_encoding: true
  upload-dir: js
  on:
    tags: true
    all_branches: true
- provider: npm
  email: serveradmin@octoblu.com
  api_key:
    secure: cxokfBSMpeaEsvWCpL8cHRwPVCSyzyq2uwUIVAH6cEFnumRxUCMsAti/DQq1QUsVf+aYW5IvkvLRCvAusXc+wdf6UrayjTCjO5zLflnh08qbmtVpftlyfEb3UpiqykoTDxeNDRbGmlof9QX2zxUsLg9CmJPP98t4qEMseGFZdFI=
  on:
    tags: true
    branches: true
