Skip to content

Commit fdcb18d

Browse files
author
John J. Rofrano
committed
initial load
1 parent 6693f3a commit fdcb18d

29 files changed

+1604
-1
lines changed

Diff for: .dockerignore

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# source files that are not needed for runtime
2+
Dockerfile
3+
Jenkinsfile
4+
README.md
5+
.travis.yml
6+
7+
# Local environment
8+
.DS_Store
9+
Thumbs.db
10+
11+
# Vagrant
12+
.vagrant
13+
Vagrantfile
14+
15+
# Git repository
16+
.git
17+
.gitignore
18+
19+
# Byte-compiled / optimized / DLL files
20+
__pycache__/
21+
*.py[cod]
22+
*$py.class
23+
24+
# C extensions
25+
*.so
26+
27+
# Distribution / packaging
28+
.Python
29+
env/
30+
build/
31+
develop-eggs/
32+
dist/
33+
downloads/
34+
eggs/
35+
.eggs/
36+
lib/
37+
lib64/
38+
parts/
39+
sdist/
40+
var/
41+
*.egg-info/
42+
.installed.cfg
43+
*.egg
44+
45+
# PyInstaller
46+
# Usually these files are written by a python script from a template
47+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
48+
*.manifest
49+
*.spec
50+
51+
# Installer logs
52+
pip-log.txt
53+
pip-delete-this-directory.txt
54+
55+
# Unit test / coverage reports
56+
htmlcov/
57+
.tox/
58+
.coverage
59+
.coverage.*
60+
.cache
61+
nosetests.xml
62+
coverage.xml
63+
*,cover
64+
.hypothesis/
65+
66+
# Translations
67+
*.mo
68+
*.pot
69+
70+
# Django stuff:
71+
*.log
72+
local_settings.py
73+
74+
# Flask stuff:
75+
instance/
76+
.webassets-cache
77+
78+
# Scrapy stuff:
79+
.scrapy
80+
81+
# Sphinx documentation
82+
docs/_build/
83+
84+
# PyBuilder
85+
target/
86+
87+
# IPython Notebook
88+
.ipynb_checkpoints
89+
90+
# pyenv
91+
.python-version
92+
93+
# celery beat schedule file
94+
celerybeat-schedule
95+
96+
# dotenv
97+
.env
98+
99+
# virtualenv
100+
venv/
101+
ENV/
102+
103+
# Spyder project settings
104+
.spyderproject
105+
106+
# Rope project settings
107+
.ropeproject

Diff for: .gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Local environment
2+
.DS_Store
3+
Thumbs.db
4+
5+
# Vagrant
6+
.vagrant
7+
18
# Byte-compiled / optimized / DLL files
29
__pycache__/
310
*.py[cod]

Diff for: .travis.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: python
2+
python:
3+
- "2.7"
4+
5+
# command to install dependencies
6+
install: "pip install -r requirements.txt"
7+
8+
# command to run tests
9+
before_script:
10+
- redis-cli ping
11+
# - "export DISPLAY=:99.0"
12+
# - "sh -e /etc/init.d/xvfb start"
13+
# - sleep 3 # give xvfb some time to start
14+
- python run.py & # start a Web server in the background
15+
- sleep 3 # give Web server some time to bind to sockets, etc
16+
17+
script:
18+
- nosetests
19+
- behave
20+
# - nosetests tests/test_selenium.py
21+
# - coverage run tests/test_server.py
22+
23+
after_success:
24+
- codecov
25+
26+
services:
27+
- redis-server

Diff for: Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Start with a Linux micro-container to keep the image tiny
2+
FROM alpine:3.3
3+
4+
# Document who is responsible for this image
5+
MAINTAINER John Rofrano "[email protected]"
6+
7+
# Install just the Python runtime (no dev)
8+
RUN apk --no-cache add \
9+
python \
10+
py-pip
11+
12+
# Expose any ports the app is expecting in the environment
13+
ENV PORT 5000
14+
EXPOSE $PORT
15+
16+
# Set up a working folder and install the pre-reqs
17+
WORKDIR /app
18+
ADD requirements.txt /app
19+
RUN pip install -r requirements.txt
20+
21+
# Add the code as the last Docker layer because it changes the most
22+
ADD . /app
23+
24+
# Run the service
25+
CMD [ "python", "run.py" ]

Diff for: Jenkinsfile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!groovy
2+
3+
node {
4+
stage ('Clone') {
5+
gotClone=true
6+
timeout(time: 60, unit: 'SECONDS') {
7+
deleteDir()
8+
checkout scm // checks out the git repo that contains this Jenkinsfile
9+
}
10+
}
11+
stage ('Test') {
12+
sh '''
13+
if [ ! -d "venv" ]; then
14+
virtualenv venv
15+
fi
16+
. venv/bin/activate
17+
pip install -q -r requirements.txt
18+
if [ ! -d "reports" ]; then
19+
mkdir reports
20+
fi
21+
nosetests --with-xunit --xunit-file=./reports/unittests.xml
22+
'''
23+
step([$class: 'XUnitBuilder',
24+
thresholds: [[$class: 'FailedThreshold', unstableThreshold: '1']],
25+
tools: [[$class: 'JUnitType', pattern: 'reports/unittests.xml']]])
26+
}
27+
}

0 commit comments

Comments
 (0)