forked from zalando-incubator/docker-locust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delivery.yaml
33 lines (31 loc) · 1.14 KB
/
delivery.yaml
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
version: "2017-09-20"
notifications:
hipchat:
rooms:
- "DP - TIP"
pipeline:
- id: build
type: script
when:
event: push
branch: master
commands:
- desc: Build, test & push the Docker image
cmd: |
export GIT_TAG=$(git describe --tags --always --dirty)
export IMAGE=registry-write.opensource.zalan.do/tip/docker-locust:$GIT_TAG
echo "Image: $IMAGE"
echo "Build docker image"
docker build -t $IMAGE --build-arg DL_IMAGE_VERSION=$GIT_TAG .
# Smoke test
echo "Deploy image locally and run simple scenario"
./local.sh deploy --target=https://google.com --locust-file=./example/simple.py --slaves=2 --mode=auto --users=2 --hatch-rate=1 --duration=5
# check if json report exists and has non-zero size
[ -s reports/requests.json ] || exit 1
# check if html report exists and has non-zero size
[ -s reports/reports.html ] || exit 1
# check if RPS value is greater than 0
cat reports/reports.html | grep 'RPS:' | cut -c 17- | awk -F'</strong' '{print ($1>0)}' | grep 1 || exit 1
# Push docker image
echo "Push docker image"
docker push $IMAGE