language: java
env:
  global:
    secure: d8h/SF0QVN0h/h5aFzPX27XfgkJXgl8ohv1K1T1ghZOzEuVneL1amczml4O6yzVWyMcsIKRj2O1UR0gstU3em4A0fKQpskPB78r4iUzWICHIkgQdW7fyIAua5PNdR/VS5feC21B9Yxf0aEFc0MvwMOiP3NNblQutMIiZVntmi7s=

install:
    - npm install

before_script: 
    - mkdir build/aws-mock-copy -p
    - shopt -s extglob
    - cp ./!(build) build/aws-mock-copy/ -r
    - cd build/aws-mock-copy
    - nohup gradle jettyRun &
    - cd ../..
    - node example/nodejs/LocalProxy.js &
    - sleep 5

script: 
    - gradle clean coberturaCheck Javadoc check
    - npm test

after_success: .utility/push-to-gh-pages.sh

after_script:
    - ps axu|grep example/nodejs/LocalProxy.js|grep -v grep|awk '{print $2}'|xargs kill -9
    - cd build/aws-mock-copy
    - gradle jettyStop
    - cd ../..
    - rm -rf build/aws-mock-copy


language: java
env:
  global:
    secure: d8h/SF0QVN0h/h5aFzPX27XfgkJXgl8ohv1K1T1ghZOzEuVneL1amczml4O6yzVWyMcsIKRj2O1UR0gstU3em4A0fKQpskPB78r4iUzWICHIkgQdW7fyIAua5PNdR/VS5feC21B9Yxf0aEFc0MvwMOiP3NNblQutMIiZVntmi7s=

install:
    - npm install

before_script: 
    - mkdir build-copy/aws-mock-copy -p
    - shopt -s extglob
    - cp ./!(build-copy) build-copy/aws-mock-copy/ -r
    - cd build-copy/aws-mock-copy
    - nohup gradle jettyRun &
    - cd ../..
    - node example/nodejs/LocalProxy.js &
    - sleep 5

script: 
    - gradle clean coberturaCheck Javadoc check
    - npm test

after_success: .utility/push-to-gh-pages.sh

after_script:
    - ps axu|grep example/nodejs/LocalProxy.js|grep -v grep|awk '{print $2}'|xargs kill -9
    - cd build-copy/aws-mock-copy
    - gradle jettyStop
    - cd ../..
    - rm -rf build-copy/aws-mock-copy


Use a new folder 'build-copy' to store the copy of aws-mock which will run jetty on port 8000, so that gradle clean would not affect the running copy of jetty
Use a new folder 'build-copy' to store the copy of aws-mock which will run jetty on port 8000, so that gradle clean would not affect the running copy of jetty
