Browse Source

Cleanup; build docker container

master
Johann Schmitz 5 months ago
parent
commit
dc3e3327c1
Signed by: ercpe <johann@j-schmitz.net> GPG Key ID: A084064277C501ED
5 changed files with 14 additions and 41 deletions
  1. +8
    -0
      Dockerfile
  2. +0
    -22
      Jenkinsfile
  3. +1
    -17
      Makefile
  4. +3
    -0
      docker/run.sh
  5. +2
    -2
      setup.py

+ 8
- 0
Dockerfile View File

@@ -0,0 +1,8 @@
FROM python:3.7-slim

ADD docker_hosts/ /app/docker_hosts
ADD docker/run.sh /app
ADD requirements.txt /app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["/app/run.sh"]

+ 0
- 22
Jenkinsfile View File

@@ -1,22 +0,0 @@
node('docker') {

stage('Checkout') {
git 'https://git.ercpe.de/ercpe/docker-hosts.git'
}

stage('CI') {
docker.withRegistry('https://r.ercpe.de', 'docker-registry') {
docker.image('r.ercpe.de/ercpe/ubuntu-build:latest').inside {
sh "make clean jenkins"
}
}
}

stage('Package') {
docker.withRegistry('https://r.ercpe.de', 'docker-registry') {
docker.image('r.ercpe.de/ercpe/ubuntu-build:latest').inside {
sh "make clean deb"
}
}
}
}

+ 1
- 17
Makefile View File

@@ -1,19 +1,6 @@
TARGET?=tests

test:
PYTHONPATH="." python3 tests/ -v

compile:
@echo Compiling python code
python3 -m compileall .

compile_optimized:
@echo Compiling python code optimized
python3 -O -m compileall .

clean:
find -name "*.py?" -delete
rm -rf MANIFEST *.egg-info dist deb_dist *.tar.gz
rm -rf MANIFEST *.egg-info dist build deb_dist *.tar.gz

install_deps:
pip3 install --user -r requirements.txt
@@ -21,6 +8,3 @@ install_deps:

deb:
python3 setup.py --command-packages=stdeb.command bdist_deb

#test
jenkins: clean install_deps compile compile_optimized

+ 3
- 0
docker/run.sh View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo "$@"
python3 -m docker_hosts "$@"

+ 2
- 2
setup.py View File

@@ -6,7 +6,7 @@ from setuptools import setup

setup(
name='docker_hosts',
version="0.1",
version="0.2",
author='Johann Schmitz',
author_email='johann@j-schmitz.net',
description='Dynamically creates /etc/hosts entries for docker containers',
@@ -14,6 +14,6 @@ setup(
url='https://git.ercpe.de/ercpe/docker-hosts',
packages=['docker_hosts'],
entry_points = {
'console_scripts': ['docker-hosts=docker_hosts.docker_hosts:main'],
'console_scripts': ['docker-hosts=docker_hosts.__main__'],
}
)

Loading…
Cancel
Save