Skip to content
Snippets Groups Projects
Commit 807b5567 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Merge branch 'master' of git.km3net.de:common/dockerfiles

parents aecbb578 0ec8de68
No related branches found
No related tags found
No related merge requests found
......@@ -8,12 +8,12 @@ variables:
before_script:
- apk --no-cache add python
- pip install gitpython
- apk --no-cache add python git
build:
script:
- git diff-tree --no-commit-id --name-only -r HEAD
- python publish_images.py
tags:
- docker
......@@ -9,5 +9,8 @@ FROM centos:7.4.1708
RUN yum install -y gtk2-devel libX11 libX11-common libX11-devel libXext libXext-devel libXft libXft-devel libXpm libXpm-devel && yum clean -y all
RUN yum install -y doxygen texlive texlive-*.noarch && yum clean -y all
RUN curl -L http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/clhep-2.2.0.8-x86_64-cc7-gcc48-opt.tgz > clhep.tgz && tar -C /usr/local/ --strip-components=1 -xvzf clhep.tgz
RUN curl -L https://root.cern.ch/download/root_v5.34.36.Linux-centos7-x86_64-gcc4.8.tar.gz > root.tar.gz && tar xvf root.tar.gz -C /usr/local/ && rm root.tar.gz
RUN sed -i 's/-std=c++11//g' /usr/local/root/bin/root-config
RUN echo "source /usr/local/root/bin/thisroot.sh" >> /etc/bashrc
FROM python:3.7.0
FROM python:3.7.1
MAINTAINER Tamas Gal <tgal@km3net.de>
RUN apt-get update -qq && apt-get install -y -qq libhdf5-dev
RUN pip install -U pip setuptools wheel
RUN pip install numpy
RUN pip install scipy pandas sklearn statsmodels numba numexpr tables h5py
RUN pip install pytest pytest-cov docopt sphinx sphinx-gallery
......
FROM python:3.5.6
MAINTAINER Tamas Gal <tgal@km3net.de>
RUN apt-get update -qq && apt-get install -y -qq libhdf5-dev
RUN pip install -U pip setuptools wheel
RUN pip install numpy
RUN pip install scipy pandas sklearn statsmodels numba numexpr tables h5py
RUN pip install pytest pytest-cov docopt sphinx sphinx-gallery
RUN pip install matplotlib seaborn pillow ipython jupyter notebook pillow
FROM python:3.6.7
MAINTAINER Tamas Gal <tgal@km3net.de>
RUN apt-get update -qq && apt-get install -y -qq libhdf5-dev
RUN pip install -U pip setuptools wheel
RUN pip install numpy
RUN pip install scipy pandas sklearn statsmodels numba numexpr tables h5py
RUN pip install pytest pytest-cov docopt sphinx sphinx-gallery
RUN pip install matplotlib seaborn pillow ipython jupyter notebook pillow
FROM python:3.7.1
MAINTAINER Tamas Gal <tgal@km3net.de>
RUN apt-get update -qq && apt-get install -y -qq libhdf5-dev
RUN pip install -U pip setuptools wheel
RUN pip install numpy
RUN pip install scipy pandas sklearn statsmodels numba numexpr tables h5py
RUN pip install pytest pytest-cov docopt sphinx sphinx-gallery
RUN pip install matplotlib seaborn pillow ipython jupyter notebook pillow
......@@ -4,31 +4,38 @@ import subprocess as sp
import sys
import time
import git
REGISTRY_URL = 'docker.km3net.de'
def get_changed_dockerfiles():
"""Checks the last Git commit and returns a list of changed Dockefiles"""
diff_cmd = "git diff-tree --no-commit-id --name-only -r HEAD"
child = sp.Popen(diff_cmd, shell=True, stdout=sp.PIPE, stderr=sp.PIPE)
out, _ = child.communicate()
changed_files = [l.decode().rstrip() for l in out.split(b'\n')]
changed_dockerfiles = [f for f in changed_files if f.startswith("base/")]
return changed_dockerfiles
def main():
changed_dockerfiles = [f.a_path for f in git.Repo('.').index.diff("HEAD~1")
if f.a_path.startswith("base/")]
changed_dockerfiles = get_changed_dockerfiles()
n_files = len(changed_dockerfiles)
if n_files == 0:
print("Nothing to do!")
exit(0)
print("Processing {} dockerfile{}..."
.format(n_files, 's' if n_files else ''))
print("Processing {} dockerfile{}...".format(n_files,
's' if n_files > 1 else ''))
for idx, fname in enumerate(changed_dockerfiles):
progress = "({}/{})".format(idx + 1, n_files)
steps = [("Building",
"docker build --pull -t {0}/{1} -f {1} . "
.format(REGISTRY_URL, fname)),
("Pushing",
"docker push {0}/{1}"
.format(REGISTRY_URL, fname))]
"docker build --pull -t {0}/{1} -f {1} . ".format(
REGISTRY_URL, fname)),
("Pushing", "docker push {0}/{1}".format(REGISTRY_URL,
fname))]
print('-' * 79)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment