diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8b780e2fc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +group: travis_latest +language: python +cache: pip +python: + - 2.7 + - 3.6 + #- nightly + #- pypy + #- pypy3 +matrix: + allow_failures: + - python: nightly + - python: pypy + - python: pypy3 +install: + #- pip install -r requirements.txt + - pip install flake8 # pytest # add another testing frameworks later +before_script: + # stop the build if there are Python syntax errors or undefined names + - flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics +script: + - true # pytest --capture=sys # add other tests here +notifications: + on_success: change + on_failure: change # `always` will be the setting once code changes slow down diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..6cd945d70 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,19 @@ +FROM debian:jessie-slim + +LABEL MAINTAINER="theonlydoo " + +WORKDIR /app + +ADD https://github.com/guardicore/monkey/releases/download/1.5.2/infection_monkey_1.5.2_deb.tgz . + +RUN tar xvf infection_monkey_1.5.2_deb.tgz \ + && apt-get -yqq update \ + && apt-get -yqq upgrade \ + && apt-get -yqq install python-pip \ + libssl-dev \ + supervisor \ + && dpkg -i *.deb + +COPY stack.conf /etc/supervisor/conf.d/stack.conf + +ENTRYPOINT [ "supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf" ] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..768730061 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,11 @@ +# Improvements needed + +* Remove embedded mongodb from .deb, it forbids installation on a `debian:stretch` distro. +* Package monkey for system's python usage. +* Fix package number: (I installed the 1.5.2) +``` +ii gc-monkey-island 1.0 amd64 Guardicore Infection Monkey Island installation package +``` +* Use .deb dependencies for mongodb setup? +* Use docker-compose for stack construction. +* Remove the .sh script from the systemd unit file (`/var/monkey_island/ubuntu/systemd/start_server.sh`) which only does a `cd && localpython run` \ No newline at end of file diff --git a/docker/stack.conf b/docker/stack.conf new file mode 100644 index 000000000..b742c0392 --- /dev/null +++ b/docker/stack.conf @@ -0,0 +1,4 @@ +[program:mongod] +command=/var/monkey_island/bin/mongodb/bin/mongod --quiet --dbpath /var/monkey_island/db +[program:monkey] +command=/var/monkey_island/ubuntu/systemd/start_server.sh