This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 128
/
circle.yml
63 lines (58 loc) · 2 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
machine:
services:
- docker
node:
version: 8.2.0
environment:
RDS_NAME: circle_test
RDS_USERNAME: ubuntu
LOCALHOST_SSL: false
DISPLAY: ":99.0"
PATH: "/home/ubuntu/screenshots/firefox:$PATH"
dependencies:
pre:
# we want firefox nightly in order to install an unsigned screenshots addon
- pip install requests
- npm i -g get-firefox
- get-firefox --branch nightly --platform linux --extract --target /home/ubuntu/screenshots
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 -extension RANDR"
compile:
override:
- make all
test:
override:
- firefox -v
# Start the server before all tests:
- node -e 'require("babel-polyfill"); require("./build/server/server");':
background: true
# addon tests
- FIREFOX_CHANNEL=NIGHTLY npm test
# server tests
- ./bin/test-request put '{}'
- ./bin/load_test_exercise.py http://localhost:10080
- npm run test:server
# run zap baseline against the server
# Only fail on error code 1, which indicates at least one FAIL was found.
# error codes 2 & 3 indicate WARN or other, and should not break the run
- docker pull owasp/zap2docker-weekly
- >
(
ip="$(ip -f inet -o addr show docker0 | awk '{print $4}' | cut -d '/' -f 1)" &&
docker run -t owasp/zap2docker-weekly zap-baseline.py \
-t http://${ip}:10080 \
-u https://raw.githubusercontent.com/mozilla-services/screenshots/master/.zap-baseline.conf;
if [ $? -ne 1 ]; then exit 0; else exit 1; fi;
)
post:
- bash <(curl -s https://codecov.io/bash)
deployment:
dev:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- ./bin/release-version dev
stage:
branch: server-prod
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- ./bin/release-version stage