box: dosomething/ds-docker-php

build:
  # The steps that will be executed on build
  steps:
    - script:
        name: start mongodb
        code: |-
          sudo /usr/bin/mongod --quiet --config /etc/mongod.conf --fork --logpath /var/log/mongod.log
    - leipert/composer-install@0.9.1
    - script:
        name: create test keys
        code: |-
          openssl genrsa -out storage/keys/private.key 1024
          openssl rsa -in storage/keys/private.key -pubout -out storage/keys/public.key
    - script:
        name: npm install
        code: |-
          mkdir -p $WERCKER_CACHE_DIR/wercker/npm
          npm config set cache $WERCKER_CACHE_DIR/wercker/npm
          npm install
    - script:
        name: build front-end assets
        code: npm run build
    - script:
        name: phpunit
        code: |-
          cp .env.example .env
          vendor/bin/phpunit

deploy:
  steps:
    - bundle-install
    - script:
        name: write private key env var
        code: |-
          export CAP_PRIVATE_KEY=`mktemp`
          echo -e $WERCKER_APP_KEY_PRIVATE > $CAP_PRIVATE_KEY
    - cap
  after-steps:
      - sherzberg/slack-notify:
          subdomain: dosomething
          token: $SLACK_TOKEN
          channel: $SLACK_ROOM

box: dosomething/ds-docker-php

build:
  # The steps that will be executed on build
  steps:
    - script:
        name: install npm 3.x
        code: npm install -g npm@3.x-latest
    - script:
        name: start mongodb
        code: |-
          sudo /usr/bin/mongod --quiet --config /etc/mongod.conf --fork --logpath /var/log/mongod.log
    - leipert/composer-install@0.9.1
    - script:
        name: create test keys
        code: |-
          openssl genrsa -out storage/keys/private.key 1024
          openssl rsa -in storage/keys/private.key -pubout -out storage/keys/public.key
    - script:
        name: npm install
        code: |-
          mkdir -p $WERCKER_CACHE_DIR/wercker/npm
          npm config set cache $WERCKER_CACHE_DIR/wercker/npm
          npm install
    - script:
        name: build front-end assets
        code: npm run build
    - script:
        name: phpunit
        code: |-
          cp .env.example .env
          vendor/bin/phpunit

deploy:
  steps:
    - bundle-install
    - script:
        name: write private key env var
        code: |-
          export CAP_PRIVATE_KEY=`mktemp`
          echo -e $WERCKER_APP_KEY_PRIVATE > $CAP_PRIVATE_KEY
    - cap
  after-steps:
      - sherzberg/slack-notify:
          subdomain: dosomething
          token: $SLACK_TOKEN
          channel: $SLACK_ROOM

Make sure we're running NPM 3.x.
Make sure we're running NPM 3.x.
