Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit fcb32cc

Browse files
committed
Add docker build and push to dockerhub to travis build
1 parent c7b78ef commit fcb32cc

File tree

4 files changed

+300
-0
lines changed

4 files changed

+300
-0
lines changed

.dockerignore

+267
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### macOS template
3+
# General
4+
.DS_Store
5+
.AppleDouble
6+
.LSOverride
7+
8+
# Icon must end with two \r
9+
Icon
10+
11+
# Thumbnails
12+
._*
13+
14+
# Files that might appear in the root of a volume
15+
.DocumentRevisions-V100
16+
.fseventsd
17+
.Spotlight-V100
18+
.TemporaryItems
19+
.Trashes
20+
.VolumeIcon.icns
21+
.com.apple.timemachine.donotpresent
22+
23+
# Directories potentially created on remote AFP share
24+
.AppleDB
25+
.AppleDesktop
26+
Network Trash Folder
27+
Temporary Items
28+
.apdisk
29+
### Emacs template
30+
# -*- mode: gitignore; -*-
31+
*~
32+
\#*\#
33+
/.emacs.desktop
34+
/.emacs.desktop.lock
35+
*.elc
36+
auto-save-list
37+
tramp
38+
.\#*
39+
40+
# Org-mode
41+
.org-id-locations
42+
*_archive
43+
44+
# flymake-mode
45+
*_flymake.*
46+
47+
# eshell files
48+
/eshell/history
49+
/eshell/lastdir
50+
51+
# elpa packages
52+
/elpa/
53+
54+
# reftex files
55+
*.rel
56+
57+
# AUCTeX auto folder
58+
/auto/
59+
60+
# cask packages
61+
.cask/
62+
63+
# Flycheck
64+
flycheck_*.el
65+
66+
# server auth directory
67+
/server/
68+
69+
# projectiles files
70+
.projectile
71+
72+
# directory configuration
73+
.dir-locals.el
74+
### VirtualEnv template
75+
# Virtualenv
76+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
77+
.Python
78+
[Bb]in
79+
[Ii]nclude
80+
[Ll]ib
81+
[Ll]ib64
82+
[Ll]ocal
83+
[Ss]cripts
84+
pyvenv.cfg
85+
.venv
86+
pip-selfcheck.json
87+
### Linux template
88+
*~
89+
90+
# temporary files which can be created if a process still has a handle open of a deleted file
91+
.fuse_hidden*
92+
93+
# KDE directory preferences
94+
.directory
95+
96+
# Linux trash folder which might appear on any partition or disk
97+
.Trash-*
98+
99+
# .nfs files are created when an open file is removed but is still being accessed
100+
.nfs*
101+
### Python template
102+
# Byte-compiled / optimized / DLL files
103+
__pycache__/
104+
*.py[cod]
105+
*$py.class
106+
107+
# C extensions
108+
*.so
109+
110+
# Distribution / packaging
111+
.Python
112+
build/
113+
dist/
114+
develop-eggs/
115+
downloads/
116+
eggs/
117+
.eggs/
118+
lib/
119+
lib64/
120+
parts/
121+
sdist/
122+
var/
123+
wheels/
124+
*.egg-info/
125+
.installed.cfg
126+
*.egg
127+
MANIFEST
128+
129+
# PyInstaller
130+
# Usually these files are written by a python script from a template
131+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
132+
*.manifest
133+
*.spec
134+
135+
# Installer logs
136+
pip-log.txt
137+
pip-delete-this-directory.txt
138+
139+
# Unit test / coverage reports
140+
htmlcov/
141+
.tox/
142+
.coverage
143+
.coverage.*
144+
.cache
145+
nosetests.xml
146+
coverage.xml
147+
*.cover
148+
.hypothesis/
149+
150+
# Translations
151+
*.mo
152+
*.pot
153+
154+
# Django stuff:
155+
*.log
156+
.static_storage/
157+
.media/
158+
local_settings.py
159+
160+
# Flask stuff:
161+
instance/
162+
.webassets-cache
163+
164+
# Scrapy stuff:
165+
.scrapy
166+
167+
# Sphinx documentation
168+
docs/_build/
169+
170+
# PyBuilder
171+
target/
172+
173+
# Jupyter Notebook
174+
.ipynb_checkpoints
175+
176+
# pyenv
177+
.python-version
178+
179+
# celery beat schedule file
180+
celerybeat-schedule
181+
182+
# SageMath parsed files
183+
*.sage.py
184+
185+
# Environments
186+
.env
187+
.venv
188+
env/
189+
venv/
190+
ENV/
191+
env.bak/
192+
venv.bak/
193+
194+
# Spyder project settings
195+
.spyderproject
196+
.spyproject
197+
198+
# Rope project settings
199+
.ropeproject
200+
201+
# mkdocs documentation
202+
/site
203+
204+
# mypy
205+
.mypy_cache/
206+
### Windows template
207+
# Windows thumbnail cache files
208+
Thumbs.db
209+
ehthumbs.db
210+
ehthumbs_vista.db
211+
212+
# Dump file
213+
*.stackdump
214+
215+
# Folder config file
216+
[Dd]esktop.ini
217+
218+
# Recycle Bin used on file shares
219+
$RECYCLE.BIN/
220+
221+
# Windows Installer files
222+
*.cab
223+
*.msi
224+
*.msm
225+
*.msp
226+
227+
# Windows shortcuts
228+
*.lnk
229+
### JetBrains template
230+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
231+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
232+
233+
# User-specific stuff:
234+
.idea
235+
236+
# CMake
237+
cmake-build-debug/
238+
cmake-build-release/
239+
240+
# Mongo Explorer plugin:
241+
.idea/**/mongoSettings.xml
242+
243+
## File-based project format:
244+
*.iws
245+
*.iml
246+
247+
## Plugin-specific files:
248+
249+
# IntelliJ
250+
out/
251+
252+
# mpeltonen/sbt-idea plugin
253+
.idea_modules/
254+
255+
# JIRA plugin
256+
atlassian-ide-plugin.xml
257+
258+
# Cursive Clojure plugin
259+
.idea/replstate.xml
260+
261+
# Crashlytics plugin (for Android Studio and IntelliJ)
262+
com_crashlytics_export_strings.xml
263+
crashlytics.properties
264+
crashlytics-build.properties
265+
fabric.properties
266+
267+
Dockerfile

.travis.yml

+13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
language: python
22
python:
33
- '3.6'
4+
sudo: required
5+
services:
6+
- docker
47
cache: pip
58
env:
9+
global:
10+
- DOCKER_USERNAME=captainfiaas
11+
- secure: rqpEgRnrN4TY9mr+9feZ74afJ015FEyRQi/sm50wqrBVJezPsNnH2mkkxAUSRABAAOhAH4r9qSCf6V3HAT5lTvyxuxlsskmrLj4jXHRNhT6g+ZV3aIekbX+og4i8V2Ap5kt2BQ2NHeOQLGI+LEYU4reaO1fishTssYPj0bBR0KdOyfj+y1+ilpYUgfRdDsX/fWisfdaYjm/HLUJ1SIz/poTSLhEGpk1JAvpe3YlUaUoDs/GfdOnOAyH5PWlwH8xU31WjoHrDVR6gRlbpk73Y65hbBMFTruy1011C7kWGFbdCG25MZbW3a54ZYGXFaiyvk4r3HlIOsWHSA+1kzqW8rrbjT67PqCp/rJMe6fXoNARvvRhrmC5EsO83L1xGNgwTR3/WvO6l+z/NTXHkQhGRtCXXr6kMXr4XbL7FJhJF6nQllIRNAcnbnW0cjOQQCvTJiLuOIoDZaZQyESmVvbO8dDIavd3rQDxhfXzfA/dHTzOv2dRtplRTYkOtSmdBwtKRTLrkpWIjGMl1nwOWXe8EeUBYY0mLfL9kVWUvTOAS1iLVkLBK+TIyHp3R4o1BIVcTFVbWsUByAjnrHda6FIjdMi2WXIo+eFnlLC/Zy5Dtj6NmVFq2+YjRQlrXqimqacex44QTOOfVBWlDPBIcRBYHTag718knX6J+z4hR0Zv1dO0= # DOCKER_PASSWORD todo replace with correct encrypted secret
612
install:
713
- pip install -e .[ci]
814
script:
915
- tox
16+
- bin/docker_build
1017
after_success: tox -e coverage
18+
deploy:
19+
provider: script
20+
script: bin/docker_push
21+
skip_cleanup: true
22+
on:
23+
branch: master

bin/docker_build

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
set -evuo pipefail
4+
5+
docker build . -t "${TRAVIS_REPO_SLUG}:latest"

bin/docker_push

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -evuo pipefail
4+
5+
VERSION=$(python setup.py --version)
6+
DOCKER_IMAGE="${TRAVIS_REPO_SLUG}:${VERSION/+/-}"
7+
8+
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
9+
10+
docker tag "${TRAVIS_REPO_SLUG}:latest" "${DOCKER_IMAGE}"
11+
12+
if [[ "${CI}" == "true" ]]; then
13+
docker push "${TRAVIS_REPO_SLUG}"
14+
echo "Pushed image ${DOCKER_IMAGE}"
15+
fi

0 commit comments

Comments
 (0)