-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
63 lines (63 loc) · 3.09 KB
/
.travis.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
sudo: required
dist: trusty
language: cpp
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- nodejs
- python
- python-pip
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
services:
- docker
before_install:
- eval "${MATRIX_EVAL}"
- docker run -d -p 0.0.0.0:5005:5005 -p 0.0.0.0:5005:5005/udp --name udp-listener mendhak/udp-listener
- docker run --name database -d -p 27017:27017 mongo:latest
- $CXX -v
- wget https://cmake.org/files/v3.12/cmake-3.12.2.tar.gz
- tar -xzf cmake-3.12.2.tar.gz
- cd cmake-3.12.2 && ./bootstrap && make > cmake_build_log.txt && sudo make install && cd ../
- mkdir $TRAVIS_BUILD_DIR/../clyman_deps
- sudo cp $TRAVIS_BUILD_DIR/scripts/linux/deb/build_deps.sh $TRAVIS_BUILD_DIR/../clyman_deps
- cd $TRAVIS_BUILD_DIR/../clyman_deps && sudo ./build_deps.sh $CXX > deps_log.txt
- sudo ldconfig
- npm install newman --global;
- pip install --user requests
- cd $TRAVIS_BUILD_DIR
- wget https://releases.hashicorp.com/packer/1.3.1/packer_1.3.1_linux_amd64.zip
- unzip packer_1.3.1_linux_amd64.zip
- sudo chmod +x packer
- export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH"
install:
- cd $TRAVIS_BUILD_DIR && make CC=$CXX CFLAGS=-O2 && make test CC=$CXX CFLAGS=-O2
before_script:
- docker logs database
script:
- cd $TRAVIS_BUILD_DIR/tests && ./tests [unit]
- cd $TRAVIS_BUILD_DIR/tests && ./tests [integration]
- cd $TRAVIS_BUILD_DIR && ./clyman clyman.prod.mongo=mongodb://localhost:27017 &
- echo $! > $TRAVIS_BUILD_DIR/pid.txt
- sleep 5
- cd $TRAVIS_BUILD_DIR/tests/postman && newman run CLyman.postman_collection.json -e ClymanTest.postman_environment.json
- cd $TRAVIS_BUILD_DIR/tests/postman && newman run CLymanFailureTests.postman_collection.json -e ClymanTest.postman_environment.json
- cd $TRAVIS_BUILD_DIR/tests/netcat && python create_data.py && ./udp_test.sh
- curl --user clyman:clymanAdminPassword --fail http://localhost:8768/health
- kill $(cat $TRAVIS_BUILD_DIR/pid.txt)
- sleep 1
- echo "kill" | nc -u -w 3 $(ip addr show eth0 | grep -Po 'inet \K[\d.]+') 8762
- docker logs udp-listener
after_success:
- cd $TRAVIS_BUILD_DIR
- ./packer build packer.json
- cd $TRAVIS_BUILD_DIR/scripts/linux && ./push_docker_image.sh $DOCKER_UN $DOCKER_PW $TRAVIS_BRANCH
notifications:
slack:
secure: YGqapA0ZH4TFv9G0otZRcqQXTpL0Y/4J51V0pm6mNp9bQi9XIoE8zoCEtZcCPnEFWjPoq8Nj1tA86WzRnriOzZIkzm83Ou/ZRcB4ZCmro0qC9fffALubzEvbqqG3TW77Xq3N7orz7Bjs8H2nxYgNQPjfQtaIMqL8ziGvf6s22LBQOBlusFJF3uELhtFCXvToKTO6XkkmLQ7Oj/qeX/kF6k7R1+lLna4JVNgkIpoEoubticMqY+/3MiS1tY41Y9phW3rxOi1O4upWnRo0fR/1fXS6Gn2Tr2PBSxdNzaJsbhJWUHf+e4DJtPkuqc7ftqSrb4DZhSukBnjXpMtE45oYcWo3h4txxTGnnzD9yMnEHegvlj1kQbcwCNc8We3RDAP80DWgvH3i1rghJ01n0okOQ4Zokz0Ntw+8pExFXO7qfa1vH3s36oIOF97cU+HWGGxqDmcBNVLNBvYfEWqWEOpZeP5p6YvnOCBwSoPXvjbcu+PeP1n9b+95ZBTTzoTJ5sHy54q7r8o/037n5kij3BfKJIjgVHkFPpXVMWkSsMZnQpBHe0RF+Iiv9SIcySF1ln3jUWIBM4heXYywYNjE6Qpw0xVQ3oq4xBPxmcSN+kcWC7wiwMGLzBQErNhbI2IRNVRAZCWIpGVnrHXB4Ev6+A2YgH4c3pWZsXmXu3L1esLv0ac=