Skip to content

Commit 264e60f

Browse files
author
Pan
committed
Updated all distribution docker files to pull and push images to/from docker hub.
Updated travis cfg.
1 parent 97184b0 commit 264e60f

File tree

11 files changed

+29
-8
lines changed

11 files changed

+29
-8
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ addons:
1515
packages:
1616
- libssh2-1-dev
1717
- openssh-server
18+
- rpm
19+
- dpkg
1820
install:
1921
- pip install flake8 jinja2
2022
- python setup.py build_ext --inplace
@@ -26,11 +28,14 @@ jobs:
2628
include:
2729
- stage: build_packages
2830
python: 3.6
29-
install: skip
31+
install:
32+
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
3033
script:
3134
- ./docker/build-packages.sh
3235
- sudo chown -R ${USER} *
3336
- ls -ltrh *.{rpm,deb}
37+
- for x in *.rpm; do echo "Package: $x"; rpm -qlp $x; done
38+
- for x in *.deb; do echo "Package: $x"; dpkg-deb -c $x; done
3439
deploy:
3540
- provider: pypi
3641
skip_cleanup: true

docker/build-packages.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,25 @@
33
for x in `ls -1d docker/{fedora,centos}*`; do
44
name=`echo "$x" | awk -F/ '{print $2}'`
55
dist_num=`echo "$name" | sed -r 's/[a-z]+([0-9]+)/\1/'`
6+
docker_tag="parallelssh/ssh2-python:$name"
67
if [[ $dist_num -gt 20 ]]; then
78
dist="fc${dist_num}"
89
else
910
dist="el${dist_num}"
1011
fi
11-
docker build $x -t $name
12+
docker pull $docker_tag || echo
13+
docker build --cache-from $docker_tag $x -t $name
14+
docker tag $name $docker_tag
15+
docker push $docker_tag
1216
docker run -v "$(pwd):/src/" "$name" --rpm-dist $dist -s python -t rpm setup.py
1317
done
1418

1519
for x in `ls -1d docker/{debian,ubuntu}*`; do
1620
name=`echo "$x" | awk -F/ '{print $2}' | awk -F. '{print $1}'`
17-
docker build $x -t "$name"
21+
docker_tag="parallelssh/ssh2-python:$name"
22+
docker pull $docker_tag || echo
23+
docker build --cache-from $docker_tag $x -t $name
24+
docker tag $name $docker_tag
25+
docker push $docker_tag
1826
docker run -v "$(pwd):/src/" "$name" --iteration $name -s python -t deb setup.py
1927
done

docker/centos6/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM cdrx/fpm-centos:6
22

33
RUN yum -y install libssh2-devel python-devel python-setuptools git
4-
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py
4+
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel

docker/centos7/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM cdrx/fpm-centos:7
22

33
RUN yum -y install libssh2-devel python-devel python-setuptools git
4-
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py
4+
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel

docker/debian7/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ FROM cdrx/fpm-debian:7
22

33
RUN apt-get -y update
44
RUN apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git
5+
RUN pip install -U setuptools
6+
RUN pip install -U pip wheel

docker/debian8/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ FROM cdrx/fpm-debian:8
22

33
RUN apt-get -y update
44
RUN apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git
5+
RUN pip install -U setuptools
6+
RUN pip install -U pip wheel

docker/fedora22/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM cdrx/fpm-fedora:22
22

33
RUN yum -y install libssh2-devel python-devel python-setuptools git
4-
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py
4+
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel

docker/fedora23/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM cdrx/fpm-fedora:23
22

33
RUN yum -y install libssh2-devel python-devel python-setuptools git
4-
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py
4+
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel

docker/fedora24/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM cdrx/fpm-fedora:24
22

33
RUN yum -y install libssh2-devel python-devel python-setuptools git
4-
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py
4+
RUN curl -sLO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && rm -f get-pip.py && pip install -U setuptools wheel

docker/ubuntu14.04/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ FROM cdrx/fpm-ubuntu:14.04
22

33
RUN apt-get -y update
44
RUN apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git
5+
RUN pip install -U setuptools
6+
RUN pip install -U pip wheel

0 commit comments

Comments
 (0)