Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Patterns for Continuous Integration with Docker using Travis CI 2 - Dev. Repo

Full story: Patterns of Continuous Integration for Data Science Python Projects

Build Status PyPI version Coverage Status Documentation Status

Conceptual Schema

The “Docker repo” pattern: create two separate Git repositories: one for Docker release and another for software development. This keeps the Docker-specific code isolated from the actual software. Developers can continue working on the source software as usual, while the production Docker image is developed separately

This repository is an example of the Git repository for software development. For an example of Git repository for Docker release, see Patterns for Continuous Integration with Docker using Travis CI 2 - Prod. Repo.

Team uses different branches for development and, a certain point, pull-requests for merge the master branch are done. For each one of them, committing the master branch:

  • modifying the version number in setup.py, a new release will be created on the package repository (e.g. PyPI),
  • modifying MkDocs mkdocs.yml and Markdown files under doc/ a new documentation is build by Read The Docs and published on-line for consultation,
  • Travis CI builds, tests and packages the software by using py.test and measuring code coverage of Python code.
  • if such tests are successful:
    • code coverage stats are published on coveralls.io through coveralls,
    • Travis CI does a release of the software by uploading the package to the package repository (e.g. PyPI),
    • Travis CI does two new docker development images, e.g. e59cbe8-develop (image for last commit on master branch) and develop (the official develop image of the project), on the Docker Registry, e.g. Docker Hub.

Dockerfile

FROM python:3.6

COPY . /myproject
WORKDIR /myproject
RUN pip install -e .

CMD ["myproject", "run"]

mkdocs.yml

site_name: Patterns for Continuous Integration with Docker using Travis CI 2 - Dev. Repo
theme: readthedocs
#docs_dir: sources
repo_url: https://github.com/gtesei/Patterns_for_Continuous_Integration_Docker_Travis_CI_2_DEV
site_description: 'Patterns for Continuous Integration with Docker using Travis CI'

nav:
- Home: index.md
- The_Repo_Pattern: 
  - Git_repository_for_software_development: git_dev.md
  - Git repository_for_Docker_release: git_docker.md

Read The Docs

Read The Docs

.travis.yml

sudo: required 
services:
- docker
env:
  global:
    - IMAGE_NAME=gtesei/hello_docker_2
    - REGISTRY_USER=gtesei
    - secure: H8o2BrmikY0e9Gzj1t/Ca1H+hblEv9GC6Qd9MQoN/zxXx0MtiZw3eyCuBO4rpYvX80oeS/e9QM1b4v8OUCsRqGd1nwz4QhRQIRyzh03+n+Sp84qnTqAZvDNbPl0WYDSJyRYFij7SpVP37encJX8ioPaE+YarNn1AGUAVthFOvWhEEeuDGV0lDOXw0j+LsXr1hf821dqvlFLBXPE0dVB6LZD2QEde4BaCQaM+FgBRrcz/bkLMBByviUxdCevJsHSOnhc4rZCbBZ5k5oByJsXVMX/S+SFwP5N4ljkF9rjtIA8fMOlGjk8Z8kXSk3BeLctXGSrZBZBsXG2e89AfBeXFrK91tYdLJROXWdd6MN+U9r+FSIblHqB51zE2zFUpXK9pijUeJLNC2eacdNMRTvxA+tudEIuGkIKkgA4aGw8knoroWXI8ByLtVJA2mXQvlMqiN+pVQt36rwx1Tz0mlw2QOsI713f/JhSoJQNX7flRJrcs2FroCCmDrnpXiE+FN+svjLKz7b07lzw8H78PGfj11YPV8LGDHMRqf0/fu55157QaDgoDKekBLuwXYGT+q5pOu91r+9ywIUo5V8WXel7VM1iUqu3Kjq8DLpwiTErENwEEoq8x5uATXAHsnoXEpBFSj6RsU1BdambMkoz7bbOgviVwTDTGB4jgX7iYdlEYdzA=
language: python
python:
    - "3.6"
cache: pip
before_install:
    - sudo apt-get update
install: 
    - pip install -r requirements-dev.txt
    - pip install pytest pytest-cov
    - pip install coveralls
script: py.test --doctest-modules --cov 
after_success:
    - coveralls
deploy:
  provider: pypi
  user: gtesei
  distributions: sdist bdist_wheel
  password:
    secure: As9TKWe41QcMXIZ0lKZ7uYblvMbOrWklUjbtZo16juLvDmQDd2dqseEv+eBuI6ur6mov8P0+8MuyOcnDcmeUT0FXTYnjw2BHQC8diH4YvNfupRv6dJDspy3UfI8koQzTJqRfoz30UoCWKS4uU9RYP3uRU6VDIabmECAtKdi3eROeeb88W9LlWMXeuQPiNZlyWFQnHrekRWfzvuZtsxkj5eRtkfUsXTnChbBru0yulv9xIJPcigvvBE/I2DF6c1KFQbtXQ2h4a1FYJ9/NbbHthtvWWSvotJK0825mhiIiCjQwy+GmsiMf5ofnVs7Fe3E0bJLdX8npPBy1BGZnVN4vd+j74Vl/Dtziy5uqFe9bPgYZk3jOBcfnDWrpAdh1Qmt1D4ZBqD0afShSyyMi0N2+B+R58bMuWj3dzgc4zZp0NjCS/S8Qt6c9Q/bYF58hA9rGKGydoKcfmdC80SUPgbYa3UKnEJo+oxtuhZlNB7A+KqccQmfPHgq/Ra4BR3ImUokhW68GVqCB1378ynNAML4vdhTHWBVRnsG+gvk1slrRsH1yOqBQo5IWMkWO8SD2OGp56u7P96m9Oh1yXhPxfCFp/9K/5IWSJ3DsA+TjieUPJW7jbMamw/CQvIOpv+VEfkorh9Oxijf22qt88/dN5OZ6Az2IAxQwBZI7D9BISnibj/w=
  on:
    branch: master
after_deploy: 
  - docker pull "${IMAGE_NAME}:develop" || true
  - docker build --pull --cache-from "${IMAGE_NAME}:develop" --tag "$IMAGE_NAME" .
  - docker login -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
  - git_sha="$(git rev-parse --short HEAD)"
  - docker tag "$IMAGE_NAME" "${IMAGE_NAME}:develop"
  - docker tag "$IMAGE_NAME" "${IMAGE_NAME}:${git_sha}-develop"
  - docker push "${IMAGE_NAME}:develop" && docker push "${IMAGE_NAME}:${git_sha}-develop"

Travis CI

Travis CI

Coveralls

Coveralls

Package repository [PyPI]

PyPI

Docker Registry [Docker Hub]

Docker Hub

Useful links

Ruby Installer for Windows

To install Travis

gem install travis

Credits

Coding Tips: Patterns for Continuous Integration with Docker on Travis CI - Part 2 of 3: The “Docker repo” pattern

Defining encrypted variables in .travis.yml

Google Cloud | Continuous Delivery with Travis CI

Continuous Integration. CircleCI vs Travis CI vs Jenkins

Continuous Integration with Jenkins and Docker

+-

Release files for python-dev-docker-project 0.5.4.dev0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-dev-docker-project 0.5.4.dev0
File Size Uploaded
python-dev-docker-project-0.5.4.dev0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-dev-docker-project 0.5.4.dev0
File Interpreter ABI Platform
python_dev_docker_project-0.5.4.dev0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 13.7 kB

Release files / python-dev-docker-project-0.5.4.dev0.tar.gz

Download URL python-dev-docker-project-0.5.4.dev0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e179dbbf88338c9cd55d2c27378bd01649e351e2f00ea64f5c4662a415b4a8a
BLAKE2b-256 checksum
How to use checksums
6d214886d7dd94512ef026eb2d3539a2adbbcd755be39b83352ce2420b3c5509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

Release files / python_dev_docker_project-0.5.4.dev0-py2.py3-none-any.whl

Download URL python_dev_docker_project-0.5.4.dev0-py2.py3-none-any.whl
Size 7.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0234d5887e96d429c02b9e6008a623670f52aaf6d9c3477f8df373c25633b71c
BLAKE2b-256 checksum
How to use checksums
2164fe9a15b8f8a4730d498171eba6f619b415f4a7fd30c1863da15789a75d60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.5.4.dev0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page