<commit_before>sudo: required

language: python

install: true

env:
  - COMMIT=${TRAVIS_COMMIT::8}
services:
  - docker

before_script:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 3 # give xvfb some time to start

before_install:
  ## Docker Build
  - export DOJO_ADMIN_USER=test_user
  - export DOJO_ADMIN_PASSWORD=<PASSWORD>
  - export REPO=appsecpipeline/django-defectdojo
  - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
  - docker build -t $REPO:${TRAVIS_COMMIT::8} .
  - docker run -e DOJO_ADMIN_USER=$DOJO_ADMIN_USER -e DOJO_ADMIN_PASSWORD=$<PASSWORD> --name dojo -d -p 127.0.0.1:8000:8000 $REPO:${TRAVIS_COMMIT::8} bash /django-DefectDojo/docker/docker-startup.bash
  - docker logs dojo
  - docker run -d --name zap --link dojo -p 127.0.0.1:8080:8080 -i owasp/zap2docker-stable zap.sh -daemon -host 0.0.0.0 -port 8080 -config api.disablekey=true
  - docker ps -a
  - docker logs dojo
  - echo "Checking to see if dojo is running"
  - curl http://localhost:8000/login?next=/
  ## Selenium and ZAP requirements
  - pip install selenium==2.53.6
  - pip install requests
  - pip install python-owasp-zap-v2.4
  - pip install prettytable
  - pip install bandit

after_success:
  ## Run the SRC:CLR Scan
  - curl -sSL https://download.sourceclear.com/ci.sh | bash
  ## Run Bandit python static code
  - bandit -r * -x venv,tests,ansible
  ## Run Docker Bench for Security
  - git clone https://github.com/docker/docker-bench-security.git
  - cd docker-bench-security
  - sh docker-bench-security.sh
  #Push to docker repo
  - sh docker/dojo-container-build-push.bash

script:
  - python tests/check_status.py -v && python tests/smoke_test.py && python tests/zap.py

addons:
  firefox: "45.0"<commit_msg>Dockerhub<commit_after>sudo: required

language: python

install: true

env:
  - COMMIT=${TRAVIS_COMMIT::8}
services:
  - docker

before_script:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 3 # give xvfb some time to start

before_install:
  ## Docker Build
  - export DOJO_ADMIN_USER=test_user
  - export DOJO_ADMIN_PASSWORD=<PASSWORD>
  - export REPO=appsecpipeline/django-defectdojo
  - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
  - docker build -t $REPO:${TRAVIS_COMMIT::8} .
  - docker run -e DOJO_ADMIN_USER=$DOJO_ADMIN_USER -e DOJO_ADMIN_PASSWORD=$DOJO_ADMIN_PASSWORD --name dojo -d -p 127.0.0.1:8000:8000 $REPO:${TRAVIS_COMMIT::8} bash /django-DefectDojo/docker/docker-startup.bash
  - docker logs dojo
  - docker run -d --name zap --link dojo -p 127.0.0.1:8080:8080 -i owasp/zap2docker-stable zap.sh -daemon -host 0.0.0.0 -port 8080 -config api.disablekey=true
  - docker ps -a
  - docker logs dojo
  - echo "Checking to see if dojo is running"
  - curl http://localhost:8000/login?next=/
  ## Selenium and ZAP requirements
  - pip install selenium==2.53.6
  - pip install requests
  - pip install python-owasp-zap-v2.4
  - pip install prettytable
  - pip install bandit

after_success:
  ## Run the SRC:CLR Scan
  - curl -sSL https://download.sourceclear.com/ci.sh | bash
  ## Run Bandit python static code
  - bandit -r * -x venv,tests,ansible
  ## Run Docker Bench for Security
  - git clone https://github.com/docker/docker-bench-security.git
  - cd docker-bench-security
  - sh docker-bench-security.sh
  #Push to docker repo
  - cd ../
  - sh docker/dojo-container-build-push.bash

script:
  - python tests/check_status.py -v && python tests/smoke_test.py && python tests/zap.py

addons:
  firefox: "45.0"
{'fraction_non_alphanumeric': 0.12743461324429606, 'fraction_numerical': 0.03171953255425709, 'mean_word_length': 3.3209134615384617, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '556263', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1351, 'n_words': 334}