212ac2f0d5
* Refactor of cameradar library * Old unit tests updated & improved. New unit tests inc * Update documentation & issue template * Update dependencies * Update TravisCI build script to reflect argument change * Remove outdated contributing guide * Update README with more examples and remove part on library * Add second camera to Travis build script & improve error detection * Fix typo in travis script & add missing image to readme * Remember that travis uses bash syntax not fish * Use relative paths for images in the README
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
dist: trusty
|
|
sudo: required
|
|
language: go
|
|
|
|
env:
|
|
- GO111MODULE=on
|
|
|
|
services:
|
|
- docker
|
|
|
|
before_install:
|
|
- echo "Testing Docker Hub credentials"
|
|
- if [[ "$DOCKER_PASSOWRD" != "" ]]; then docker login -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD; fi
|
|
- echo "Docker Hub credentials are working"
|
|
# If I see one day that Travis CI updates their default docker version
|
|
# I can remove the lines below. That's why I leave this here :-)
|
|
- docker version
|
|
- sudo apt-get remove docker docker-engine docker.io
|
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
- sudo apt-get update
|
|
- sudo apt-get install -y docker-ce nmap
|
|
- go get github.com/mattn/goveralls
|
|
- docker version
|
|
|
|
install:
|
|
- docker build -t cameradar .
|
|
|
|
script:
|
|
# Run unit tests
|
|
- go test -v -covermode=count -coverprofile=coverage.out
|
|
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken=$COVERALLS_TOKEN
|
|
# Launch fake cameras to check if cameradar is able to access them
|
|
- docker run -d --name="fake_camera_digest" -e RTSP_ROUTE="/live.sdp" -e RTSP_USERNAME="admin" -e RTSP_PASSWORD="12345" -e RTSP_AUTHENTICATION_METHOD="digest" -p 8554:8554 ullaakut/rtspatt
|
|
- docker run -d --name="fake_camera_basic" -e RTSP_ROUTE="/live.sdp" -e RTSP_USERNAME="root" -e RTSP_PASSWORD="root" -e RTSP_AUTHENTICATION_METHOD="digest" -p 5554:5554 ullaakut/rtspatt
|
|
# Launch cameradar on the local machine
|
|
- docker run --net=host -t cameradar -t 0.0.0.0 -p 8554,5554 -v > logs.txt
|
|
# Gather the logs from the cameras
|
|
- docker logs fake_camera_digest > camera_digest_logs.txt
|
|
- docker logs fake_camera_basic > camera_basic_logs.txt
|
|
# Stop the fake cameras
|
|
- docker stop fake_camera_basic
|
|
- docker stop fake_camera_digest
|
|
# Print logs
|
|
- cat camera_digest_logs.txt
|
|
- cat camera_basic_logs.txt
|
|
- cat logs.txt
|
|
- grep "Successful attack" logs.txt || exit 1
|
|
|
|
notifications:
|
|
email:
|
|
recipients:
|
|
- brendan.le-glaunec@epitech.eu
|
|
on_success: never
|
|
on_failure: always
|