Skip to content

Commit f736a15

Browse files
author
Pan
committed
Updated system package build docker files - resolves #122.
Re-enabled travis cfg for system packages. Updated setup.py for readthedocs integration.
1 parent a7fdf17 commit f736a15

File tree

14 files changed

+164
-78
lines changed

14 files changed

+164
-78
lines changed

.travis.yml

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,31 @@ after_success:
3838

3939
jobs:
4040
include:
41-
- stage: build wheels
41+
42+
- stage: build packages
4243
os: osx
43-
osx_image: xcode9.3
44-
# if: tag IS present
44+
osx_image: xcode6.4
4545
before_install:
4646
- brew update
4747
install:
4848
- brew upgrade openssl
4949
- sudo ci/install-ssh2.sh
50-
- sudo -H pip2 install -U delocate twine wheel pip setuptools
51-
- cp /usr/local/lib/libssh2* .
5250
- ls -lh
53-
- pip2 install --user -r requirements.txt
54-
- pip2 wheel --no-deps .
51+
- python --version
52+
- wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
53+
- sudo python get-pip.py
54+
- sudo -H pip install -U pip
55+
- sudo -H pip install -U delocate twine wheel pip setuptools
56+
- cp /usr/local/lib/libssh2* .
57+
- pip install --user -r requirements.txt
58+
- pip wheel --no-deps .
5559
script:
5660
- delocate-listdeps --all *.whl
5761
- delocate-wheel -v *.whl
5862
- delocate-listdeps --all *.whl
5963
- ls -l *.whl
6064
- rm -f *.dylib
61-
- pip2 install --user -v *.whl
65+
- pip install --user -v *.whl
6266
- pwd; mkdir temp; cd temp; pwd
6367
- python -c "import pssh.clients"
6468
- cd ..; pwd
@@ -69,10 +73,9 @@ jobs:
6973
language: generic
7074
python: skip
7175

72-
- stage: build wheels
76+
- stage: build packages
7377
os: osx
7478
osx_image: xcode8.3
75-
# if: tag IS present
7679
before_install:
7780
- brew update
7881
install:
@@ -100,10 +103,9 @@ jobs:
100103
language: generic
101104
python: skip
102105

103-
- stage: build wheels
106+
- stage: build packages
104107
os: osx
105108
osx_image: xcode8
106-
# if: tag IS present
107109
before_install:
108110
- brew update
109111
install:
@@ -131,31 +133,26 @@ jobs:
131133
language: generic
132134
python: skip
133135

134-
- stage: build wheels
136+
- stage: build packages
135137
os: osx
136-
osx_image: xcode6.4
137-
# if: tag IS present
138+
osx_image: xcode9.3
138139
before_install:
139140
- brew update
140141
install:
141142
- brew upgrade openssl
142143
- sudo ci/install-ssh2.sh
143-
- ls -lh
144-
- python --version
145-
- wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py
146-
- sudo python get-pip.py
147-
- sudo -H pip install -U pip
148-
- sudo -H pip install -U delocate twine wheel pip setuptools
144+
- sudo -H pip2 install -U delocate twine wheel pip setuptools
149145
- cp /usr/local/lib/libssh2* .
150-
- pip install --user -r requirements.txt
151-
- pip wheel --no-deps .
146+
- ls -lh
147+
- pip2 install --user -r requirements.txt
148+
- pip2 wheel --no-deps .
152149
script:
153150
- delocate-listdeps --all *.whl
154151
- delocate-wheel -v *.whl
155152
- delocate-listdeps --all *.whl
156153
- ls -l *.whl
157154
- rm -f *.dylib
158-
- pip install --user -v *.whl
155+
- pip2 install --user -v *.whl
159156
- pwd; mkdir temp; cd temp; pwd
160157
- python -c "import pssh.clients"
161158
- cd ..; pwd
@@ -165,30 +162,32 @@ jobs:
165162
fi
166163
language: generic
167164
python: skip
168-
# - os: linux
169-
# stage: build system packages
170-
# if: tag IS present
171-
# python: 3.6
172-
# before_install: skip
173-
# install: skip
174-
# # script: skip
175-
# after_success: skip
176-
# # before_deploy:
177-
# script:
178-
# - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
179-
# - ./ci/docker/build-packages.sh
180-
# deploy:
181-
# - provider: releases
182-
# skip_cleanup: true
183-
# api_key:
184-
# secure: hKf+D9ZWRCJWNQtlOWeFh7z1a+VSz+GK5qOY0e1+iV/PrM0f41wy2yej0bxG1zS6CQAnJBK6/gmq5uXXhQhGNQeIQs7zElyKlrijQAn5UstPPJTRIk2oywRr2b+q0k3V42tto6WbhjqPRpOQl/pNTjKJCc/UPgd6kOVZEhCfAec=
185-
# file_glob: true
186-
# file: '*.{deb,rpm}'
187-
# on:
188-
# repo: ParallelSSH/parallel-ssh
189-
# tags: true
190165

191-
- stage: build wheels
166+
- os: linux
167+
stage: build packages
168+
env:
169+
- SYSTEM_PACKAGES=1
170+
python: 3.6
171+
before_install: skip
172+
install: skip
173+
after_success: skip
174+
script:
175+
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
176+
- ./ci/docker/build-packages.sh
177+
deploy:
178+
- provider: releases
179+
skip_cleanup: true
180+
api_key:
181+
secure: hKf+D9ZWRCJWNQtlOWeFh7z1a+VSz+GK5qOY0e1+iV/PrM0f41wy2yej0bxG1zS6CQAnJBK6/gmq5uXXhQhGNQeIQs7zElyKlrijQAn5UstPPJTRIk2oywRr2b+q0k3V42tto6WbhjqPRpOQl/pNTjKJCc/UPgd6kOVZEhCfAec=
182+
file_glob: true
183+
file: '*.{deb,rpm}'
184+
on:
185+
repo: ParallelSSH/parallel-ssh
186+
tags: true
187+
188+
- stage: build packages
189+
env:
190+
- WHEELS=1
192191
os: linux
193192
python: 3.6
194193
before_install: skip

ci/appveyor/fix_version.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
from datetime import datetime
3+
import subprocess
4+
import json
5+
import sys
6+
7+
def get_describe_tag():
8+
return subprocess.check_output(['git', 'describe', '--tags']).strip().decode('utf-8')
9+
10+
def make_version_file(basedir):
11+
rev = os.environ.get('APPVEYOR_REPO_COMMIT',
12+
subprocess.check_output(['git', 'rev-list', '--max-count=1', 'HEAD']).strip().decode('utf-8'))
13+
basedir = os.path.abspath(basedir)
14+
git_desc = get_describe_tag()
15+
version_json = {'date': datetime.now().isoformat(),
16+
'dirty': False,
17+
'error': None,
18+
'full-revisionid': rev,
19+
'version': git_desc}
20+
data = """
21+
import json
22+
23+
version_json = '''
24+
%s''' # END VERSION_JSON
25+
26+
27+
def get_versions():
28+
return json.loads(version_json)
29+
30+
""" % (json.dumps(version_json))
31+
with open(os.path.join(basedir, 'pssh', '_version.py'), 'w') as fh:
32+
fh.write(data)
33+
34+
35+
if __name__ == "__main__":
36+
if not len(sys.argv) > 1:
37+
sys.stderr.write("Need basedir of repo" + os.linesep)
38+
sys.exit(1)
39+
make_version_file(sys.argv[1])

ci/docker/build-packages.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
for x in `ls -1d ci/docker/{fedora,centos}*`; do
44
name=`echo "$x" | awk -F/ '{print $3}'`
55
dist_num=`echo "$name" | sed -r 's/[a-z]+([0-9]+)/\1/'`
6-
docker_tag="parallelssh/ssh2-python:$name"
6+
docker_tag="parallelssh/parallel-ssh-pkgs:$name"
77
if [[ $dist_num -gt 20 ]]; then
88
dist="fc${dist_num}"
99
else
@@ -12,23 +12,33 @@ for x in `ls -1d ci/docker/{fedora,centos}*`; do
1212
docker pull $docker_tag || echo
1313
docker build --cache-from $docker_tag $x -t $name
1414
docker tag $name $docker_tag
15-
# docker push $docker_tag
16-
# sudo rm -rf build dist
17-
docker run -v "$(pwd):/src/" "$name" --rpm-dist $dist -s python -t rpm setup.py
15+
docker push $docker_tag
16+
sudo rm -rf build dist
17+
# Fix version used by versioneer to current git tag so the generated .c files
18+
# do not cause a version change.
19+
python ci/appveyor/fix_version.py .
20+
# C files need re-generating
21+
sudo rm -f pssh/native/*.c
22+
docker run -v "$(pwd):/src/" "$name" fpm --rpm-dist $dist -s python -t rpm setup.py
1823
done
1924

2025
for x in `ls -1d ci/docker/{debian,ubuntu}*`; do
2126
name=`echo "$x" | awk -F/ '{print $3}' | awk -F. '{print $1}'`
22-
docker_tag="parallelssh/ssh2-python:$name"
27+
docker_tag="parallelssh/parallel-ssh-pkgs:$name"
2328
docker pull $docker_tag || echo
2429
docker build --cache-from $docker_tag $x -t $name
2530
docker tag $name $docker_tag
26-
# docker push $docker_tag
27-
# sudo rm -rf build dist
28-
docker run -v "$(pwd):/src/" "$name" --iteration $name -s python -t deb setup.py
31+
docker push $docker_tag
32+
sudo rm -rf build dist
33+
# Fix version used by versioneer to current git tag so the generated .c files
34+
# do not cause a version change.
35+
python ci/appveyor/fix_version.py .
36+
# C files need re-generating
37+
sudo rm -f pssh/native/*.c
38+
docker run -v "$(pwd):/src/" "$name" fpm --iteration $name -s python -t deb setup.py
2939
done
3040

31-
# sudo chown -R ${USER} *
41+
sudo chown -R ${USER} *
3242

3343
ls -ltrh *.{rpm,deb}
3444

ci/docker/centos6/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

ci/docker/centos7/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
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 && pip install -U setuptools wheel
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 && pip install cython
5+
RUN pip install ssh2-python gevent paramiko
6+
7+
ENV EMBEDDED_LIB 0
8+
ENV HAVE_AGENT_FWD 0

ci/docker/debian7/Dockerfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

ci/docker/debian8/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
FROM cdrx/fpm-debian:8
22

3-
RUN apt-get -y update
4-
RUN apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git
3+
RUN apt-get -y update && apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git
54
RUN pip install -U setuptools
65
RUN pip install -U pip wheel
6+
RUN pip install cython
7+
RUN pip install ssh2-python gevent paramiko
8+
9+
ENV EMBEDDED_LIB 1
10+
ENV HAVE_AGENT_FWD 0

ci/docker/fedora22/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
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 && pip install -U setuptools wheel
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 && pip install cython
5+
RUN pip install ssh2-python gevent paramiko
6+
7+
ENV EMBEDDED_LIB 0
8+
ENV HAVE_AGENT_FWD 0

ci/docker/fedora23/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
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 && pip install -U setuptools wheel
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 && pip install cython
5+
RUN pip install ssh2-python gevent paramiko
6+
7+
ENV EMBEDDED_LIB 0
8+
ENV HAVE_AGENT_FWD 0

ci/docker/fedora24/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
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 && pip install -U setuptools wheel
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 && pip install cython
5+
RUN pip install ssh2-python gevent paramiko
6+
7+
ENV EMBEDDED_LIB 1
8+
ENV HAVE_AGENT_FWD 0

0 commit comments

Comments
 (0)