Skip to content

Commit

Permalink
Merge pull request #58 from ait-aecid/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
whotwagner authored May 29, 2020
2 parents f0a6304 + ddc6633 commit 146a838
Show file tree
Hide file tree
Showing 215 changed files with 21,653 additions and 9,210 deletions.
17 changes: 17 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version = 1

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
max_line_length = 140

[[analyzers]]
name = "test-coverage"
enabled = true

exclude_patterns = [
"aecid-testsuite/system/performance-tests/results/*/*/*.py"
]
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.pyc
# ignore ansible-roles
roles/
playbook.yml
playbook.retry
15 changes: 0 additions & 15 deletions .gitlab-ci.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# aminer-ansible: https://github.com/ait-aecid/aminer-ansible.git
- hosts: localhost
vars:
aminer_gitrepo: False
# MODIFY THIS PATH
aminer_repopath: "{{SOURCEDIR}}"
roles:
- aminer
38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
language: python
python:
- '3.7'
dist: bionic

before_install:
- sudo apt-get update -y
- sudo apt-get install -y exim4 procps cpulimit ansible mailutils python3-pip python3-kafka
- git clone https://github.com/ait-aecid/aminer-ansible.git roles/aminer
- cp $PWD/source/root/etc/aminer/conf-available/generic/ApacheAccessModel.py $PWD/source/root/etc/aminer/conf-enabled/ApacheAccessModel.py
- ln -s $PWD/source/root/usr/lib/logdata-anomaly-miner/aminer $PWD/aecid-testsuite/aminer
- ln -s $PWD/source/root/etc/aminer/template_config.py $PWD/aecid-testsuite/demo/AMiner/template_config.py
- sed -e "s+{{SOURCEDIR}}+$PWD+g" .playbook.yml > playbook.yml

install:
- sudo -H -u root pip3 install coverage
- sudo ansible-playbook playbook.yml
- sudo ln -s /usr/lib/python3/dist-packages/kafka /etc/aminer/conf-enabled/kafka
- cd aecid-testsuite
- sudo chmod +x runUnittests.sh
- sudo chmod +x runAMinerDemo.sh
- sudo chmod +x runAMinerIntegrationTest.sh
- sudo chmod +x runCoverageTests.sh

script:
- ./runUnittests.sh
- ./runAMinerDemo.sh demo/AMiner/demo-config.py
- ./runAMinerDemo.sh demo/AMiner/jsonConverterHandler-demo-config.py
- ./runAMinerDemo.sh demo/AMiner/template_config.py
- ./runAMinerIntegrationTest.sh aminerIntegrationTest.sh config.py
- ./runAMinerIntegrationTest.sh aminerIntegrationTest2.sh config21.py config22.py
- ./runCoverageTests.sh

after_script:
- cd ..
- rm $PWD/aecid-testsuite/aminer
- rm $PWD/source/root/usr/lib/logdata-anomaly-miner/ApacheAccessModel.py
- rm $PWD/aecid-testsuite/demo/AMiner/template_config.py
5 changes: 3 additions & 2 deletions Build
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ _tmpRoot="$(mktemp -d)"
echo "Building package at ${_tmpRoot}" >&2

_debDirectory="${_tmpRoot}/deb-build"
_tarVersion=$(head -1 source/debian/changelog | awk 'match($0, /\(.*\)/) {
_tarVersion=$(head -1 debian/changelog | awk 'match($0, /\(.*\)/) {
print substr($0, RSTART+1, RLENGTH-4)
}
')
mkdir -- "${_debDirectory}"
cp -a -- "${_projectDir}/source/debian" "${_projectDir}/source/root" "${_debDirectory}"
cp -a -- "${_projectDir}/debian" "${_projectDir}/source/root" "${_debDirectory}"
cp -a -- "${_projectDir}/README.md" "${_debDirectory}"
fakeroot -- tar -C ${_debDirectory} -czf "${_tmpRoot}/logdata-anomaly-miner_${_tarVersion}.orig.tar.gz" --transform 's,^./,deb-build/,' .
gpg -ab "${_tmpRoot}/logdata-anomaly-miner_${_tarVersion}.orig.tar.gz"

Expand Down
Loading

0 comments on commit 146a838

Please sign in to comment.