Coder Social home page Coder Social logo

cirulls / dockercon2015 Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 18.0 238 KB

Sample code for the DockerCon Europe 2015 presentation "Continuous Integration with Jenkins, Docker and Compose" (http://sandrocirulli.net/dockercon2015).

License: GNU General Public License v3.0

Shell 100.00%

dockercon2015's Introduction

dockercon2015

This repository contains sample code of my presentation "Continuous Integration with Jenkins, Docker and Compose" presented at DockerCon Europe 2015 (see http://sandrocirulli.net/dockercon2015).

If you are interested in this code, you may want to watch the following videos where I explain the Continuous Integration workflow I used:

DockerCon Europe 2015 presentation

Demo part 1

Demo part 2

Note that the code in this repository is just sample code to illustrate the videos and the slides. It won't work if you try to run it as there are lots of missing files. The sample code comes from my employer's private repositories and I cannot make them public.

Scripts

manage-leap-components.sh is an interactive shell script mainly written by my colleague Meritxell. It allows to start/stop/build Docker containers and images without much knowledge of Docker or Docker Compose. When you run this script, it presents you with options in order to run Docker and Compose commands for you. This script is also invoked by the api/update.sh. The IP addresses in the script are obviously fake.

The sed instructions in manage-leap-components.sh are used to replace the empty environment variables with the value specific the environment (dev, stage, live) in docker-compose-aws.yml. In this way it is possible to have a single script for dev, stage, and live environments. A major improvement would be to use variable substitution (now supported in Docker Compose, it was not available at the time).

Jenkins container

The Jenkins image is based on the platform_base image. This is a customized version of the official CentOS image with the addition of common libraries shared across other Docker images.

Note that at the time I used Docker Compose 1.2 inside the Jenkins container, I recommend to use a more modern version. Similarly, the version of Jenkins that was installed at the time was 1.619.

update.sh is the script executed by the Jenkins job. It invokes the script manage-leap-components.sh which is essentially a wrapper around Docker and Docker Compose commands. This is a screenshot of the Jenkins job configuration to build the API image, stop the API container, and start the new API container based on the latest Docker image.

Jenkins Configuration

API container

The API container is a Python Flask application running an API. update.sh is probably the file you may want to inspect as it is used by the Jenkins job.

Feedback

Note that I have not committed all the files referenced in the Dockerfiles. If there are other files you may find useful to inspect, feel free to contact me or raise an issue in the issue tracker.

Let me know if you find these files useful. All the code in this repository is under licensed under GPL v3.

dockercon2015's People

Contributors

cirulls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.