forked from jeff1evesque/machine-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (80 loc) · 3.77 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
sudo: required
language: python
## allows 'docker' command
services:
- docker
## build docker, install puppet (i.e. puppet parser validate)
before_install:
- docker build -f docker/default.dockerfile -t container-default .
- docker build -f docker/redis.dockerfile -t container-redis .
- docker build -f docker/database.dockerfile -t container-database .
- docker build -f docker/webserver.dockerfile -t container-webserver .
- wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
- sudo dpkg -i puppetlabs-release-pc1-trusty.deb
- sudo apt-get update
- sudo apt-get install puppet-agent -y
- sudo /opt/puppetlabs/bin/puppet -V
## install packages for linting
#
# @trusty-backports, allows additional packages (i.e. shellcheck) to be installed
#
# Note: unit testing is performed within the docker container, which is
# defined from the Dockerfile.
install:
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-backports restricted main universe"
- pip install flake8==2.5.4
- npm install -g [email protected]
- npm install -g [email protected]
- gem install scss_lint -v 0.38.0
- npm install -g [email protected]
- gem install puppet-lint -v 1.1.0
- gem install r10k -v 2.2.0
- npm install -g [email protected]
- gem install csvlint -v 0.3.0
- sudo apt-get update
- sudo apt-get install libxml2-utils=2.9.1+dfsg1-3ubuntu4.8
- gem install mdl -v 0.3.1
- sudo apt-get install shellcheck=0.3.3-1~ubuntu14.04.1
- npm install -g eslint [email protected]
- npm install -g [email protected]
- gem install yaml-lint -v 0.0.7
- npm install -g [email protected]
## implement linting
#
# @puppet-lint, the following issue needs to be checked if it has been
# resolved, so the '--no-ensure_first_param-check' abusive flag
# implementation (below) can be removed:
#
# - https://github.com/rodjek/puppet-lint/issues/410
#
# @docker run:
# -d, run container in background and print container ID
# -t, allocate pseudo-tty instead of default tty to running container
#
# Note: unit testing is performed within the docker container, which is
# defined from the Dockerfile.
script:
- flake8 .
- jshint --verbose src/js/*.js --config test/config/jshint.json --exclude-path test/config/.jshintignore
- jscs . --config test/config/.jscs.json
- scss-lint src/scss/*.scss
- bootlint -d W005 interface/templates/*.html
- sudo find puppet/environment/*/manifests -name '*.pp' -type f -exec /opt/puppetlabs/bin/puppet parser validate {} \;
- sudo find puppet/environment/*/modules -name '*.pp' -type f -exec /opt/puppetlabs/bin/puppet parser validate {} \;
- puppet-lint --no-variable_scope-check --no-ensure_first_param-check puppet/environment/*/modules
- find puppet -name Puppetfile -exec sh -c 'cd "${1%/*}" && r10k puppetfile check Puppetfile' _ {} \;
- find interface/static/data/json -name '*.json' -exec jsonlint -q {} \; -print
- find interface/static/data/csv -name '*.csv' -exec csvlint {} \;
- xmllint --noout interface/static/data/xml/svr*.xml --schema interface/static/data/xml/svr.xsd
- xmllint --noout interface/static/data/xml/svm*.xml --schema interface/static/data/xml/svm.xsd
- xmllint --noout interface/static/data/xml/*.xsd
- mdl . --style test/config/markdown.rb
- find . -type f -exec grep -l '^#!/bin/bash' {} + | xargs shellcheck
- find . -name '*.sh' -type f -exec shellcheck {} \;
- eslint . --ext=jsx -c test/config/eslint.json
- yaml-lint hiera/
- yaml-lint *.yaml
- find . -name '*.dockerfile' -type f -exec dockerlint {} \;
- docker run -dt --name redis container-redis
- docker run -dt --name database container-database
# - docker run --link redis:container-redis --link database:container-database container-webserver bash -c "cd /var/machine-learning/test; py.test"