Jenkins is a good tool for continuous integrations and system build.

Install from Installing Jenkins on Ubuntu

Configration file:

sudo vi /etc/default/jenkins
# You could change the port from HTTP_PORT variable

Nginx configuration:

upstream app_server {
    server fail_timeout=0;

server {
    listen 80;
    server_name jenkins_server;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;

        if (!-f $request_filename) {
            proxy_pass http://app_server;

Setting up a secured Jenkins instance

Manage Jenkins -> Configure Global Security:

Git, Bitbucket and Jenkins:

Enable these plugins:

Setup Project from configuration to pull repositories from Git and put the urls and credential.To trigger builds when pushing commit:

Python Project

First you need to install virtualenv on the server

Build script:

echo "Start build scripts"

if [ ! -d $PYENV_HOME ]; then
        virtualenv --no-site-packages $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet -r requirements.txt --download-cache=/tmp/$JOB_NAME

echo "END build scripts"


comments powered by Disqus