|
1 |
| -machine: |
2 |
| - node: |
3 |
| - version: 6.9.1 |
4 |
| - environment: |
5 |
| - # Fix issue with selenium-server in containers. |
6 |
| - # See http://github.com/SeleniumHQ/docker-selenium/issues/87 |
7 |
| - DBUS_SESSION_BUS_ADDRESS: /dev/null |
8 |
| - |
9 |
| -dependencies: |
10 |
| - override: |
11 |
| - - npm i |
12 |
| - cache_directories: |
13 |
| - - testapp/node_modules |
14 |
| - post: |
15 |
| - - ./node_modules/.bin/gulp lint |
16 |
| - - ./node_modules/.bin/webdriver-manager update |
17 |
| - - ./node_modules/.bin/webdriver-manager start: |
18 |
| - background: true |
19 |
| - - cd testapp && npm i |
20 |
| - - npm start: |
| 1 | +version: 2 |
| 2 | +jobs: |
| 3 | + build: |
| 4 | + docker: |
| 5 | + - image: circleci/node:6.14-browsers |
| 6 | + environment: |
| 7 | + # Fix issue with selenium-server in containers. |
| 8 | + # See http://github.com/SeleniumHQ/docker-selenium/issues/87 |
| 9 | + DBUS_SESSION_BUS_ADDRESS: /dev/null |
| 10 | + steps: |
| 11 | + - checkout |
| 12 | + |
| 13 | + - run: |
| 14 | + name: Install Dependencies |
| 15 | + command: | |
| 16 | + sudo apt-get update |
| 17 | + sudo apt-get install python-pip tcpdump |
| 18 | +
|
| 19 | + # Have to update firefox, default is ESR. |
| 20 | + sudo pip install --upgrade pip |
| 21 | + sudo pip install mozdownload mozinstall |
| 22 | + mozdownload --version latest --destination firefox.tar.bz2 |
| 23 | + mozinstall firefox.tar.bz2 |
| 24 | + sudo cp -R firefox/* /opt/firefox/ |
| 25 | +
|
| 26 | + # Latest chrome is already installed in the default container. |
| 27 | + # curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb |
| 28 | + # sudo dpkg -i google-chrome.deb |
| 29 | + # sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome |
| 30 | + # rm google-chrome.deb |
| 31 | +
|
| 32 | + - restore_cache: |
| 33 | + key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }} |
| 34 | + |
| 35 | + - run: |
| 36 | + name: NPM Install |
| 37 | + command: | |
| 38 | + npm i |
| 39 | + cd testapp && npm i |
| 40 | +
|
| 41 | + - save_cache: |
| 42 | + key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }} |
| 43 | + paths: |
| 44 | + - "node_modules" |
| 45 | + - "testapp/node_modules" |
| 46 | + |
| 47 | + - run: |
| 48 | + name: Lint |
| 49 | + command: ./node_modules/.bin/gulp lint |
| 50 | + |
| 51 | + - run: |
| 52 | + name: Selenium Start |
21 | 53 | background: true
|
22 |
| - - sudo apt-get update |
23 |
| - # Install the latest Firefox beta |
24 |
| - - pip install --upgrade pip |
25 |
| - - pip install mozdownload mozinstall |
26 |
| - - mozdownload --version latest --destination firefox.tar.bz2 |
27 |
| - - mozinstall firefox.tar.bz2 |
28 |
| - - sudo cp -R firefox/* /opt/firefox/ |
29 |
| - # Install the latest Chrome |
30 |
| - - curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb |
31 |
| - - sudo dpkg -i google-chrome.deb |
32 |
| - - sudo sed -i 's|HERE/chrome\"|HERE/chrome\" --disable-setuid-sandbox|g' /opt/google/chrome/google-chrome |
33 |
| - - rm google-chrome.deb |
34 |
| - # Extra tcp logging for BlockingProxy |
35 |
| - - sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap: |
| 54 | + command: | |
| 55 | + ./node_modules/.bin/webdriver-manager update |
| 56 | + ./node_modules/.bin/webdriver-manager start |
| 57 | +
|
| 58 | + - run: |
| 59 | + name: TestApp Start |
36 | 60 | background: true
|
| 61 | + command: | |
| 62 | + npm start |
| 63 | +
|
| 64 | + # Seems like the new circleci container no longer permits packet introspection on lo, even for root. |
| 65 | + # - run: |
| 66 | + # name: Extra tcp logging for BlockingProxy |
| 67 | + # background: true |
| 68 | + # command: sudo tcpdump -i lo 'tcp && dst localhost' -w $CIRCLE_ARTIFACTS/localdump.pcap |
37 | 69 |
|
38 |
| -test: |
39 |
| - override: |
40 |
| - - npm test |
| 70 | + - run: |
| 71 | + name: Test |
| 72 | + command: npm test |
0 commit comments