language: node_js
node_js:
  - 7
script:
  - npm run lint && npm run test
  - yarn jest
  - 'if [[ ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH} = "master" ]]; then npm install -g grunt npm@5.2 && grunt pre-build; fi'
after_success:
  - openssl aes-256-cbc -K $encrypted_440d7f9a3c38_key -iv $encrypted_440d7f9a3c38_iv
    -in .snapcraft/travis_snapcraft.cfg -out .snapcraft/snapcraft.cfg -d
sudo: required
services:
  - docker
deploy:
  'on':
    branch: master
  provider: script
  script: if [ ${TRAVIS_NODE_VERSION} = "stable" ];then docker run -v $(pwd):$(pwd) -t snapcore/snapcraft sh -c "apt update -qq
    && cd $(pwd) && snapcraft && snapcraft push *.snap --release edge"; fi
  skip_cleanup: true
