Skip to content

Commit a1af6f4

Browse files
author
Pan
committed
Fixed system package build scripts and docker files - resolves #25.
Re-enabled system package releases. Updated documentation. Added ubuntu 18.04 package build. Removed redhat 6 and debian 7 builds.
1 parent a7e8d65 commit a1af6f4

File tree

17 files changed

+140
-61
lines changed

17 files changed

+140
-61
lines changed

.travis.yml

Lines changed: 60 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ script:
3232
- cd doc; make html; cd ..
3333
jobs:
3434
include:
35-
- stage: OSX wheel build
35+
- stage: build packages
3636
os: osx
37-
if: tag IS present
3837
before_install:
3938
- brew update
4039
install:
@@ -60,10 +59,10 @@ jobs:
6059
fi
6160
language: generic
6261
python: skip
63-
- stage: OSX wheel build
62+
63+
- stage: build packages
6464
os: osx
6565
osx_image: xcode8
66-
if: tag IS present
6766
before_install:
6867
- brew update
6968
install:
@@ -90,10 +89,10 @@ jobs:
9089
fi
9190
language: generic
9291
python: skip
93-
- stage: OSX wheel build
92+
93+
- stage: build packages
9494
os: osx
9595
osx_image: xcode6.4
96-
if: tag IS present
9796
before_install:
9897
- brew update
9998
install:
@@ -123,29 +122,63 @@ jobs:
123122
fi
124123
language: generic
125124
python: skip
126-
# - stage: build_packages
127-
# if: tag IS present
128-
# os: linux
129-
# python: 3.6
130-
# install: skip
131-
# script: skip
132-
# before_deploy:
133-
# - docker --version
134-
# - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
135-
# - ./ci/docker/build-packages.sh
136-
# deploy:
137-
# - provider: releases
138-
# skip_cleanup: true
139-
# api_key:
140-
# secure: i1Dr0k393wXBsCKST5ckeTPdZT+hjkikHCGgMSEkJxw+Q8m/Sgq9bbBalkJZDZDc8t0a/nE4ioEXoYO+PT9wRSpjLbjDVwRoWde5PVHaR3JviiwxULEynFLbvdJ1S2O/zRM37YMVgIIXN/2SWSXvQcQznrrvjtBoV+nZfYHX2WZQruq1nQXcPvTJPeZtCBsWaA3TwbVobnOJdb3TFxnHybN3N4gCTOkurek0V7OSMpjd1qgSzNMDIhjXKf/ZB9bcuusXo2QSnzUDJo3S6QE4FBxKohVom7z4AQ8+iRVPkkrWezBo089vzPzfZN/C5+8xQAUfZ6bVNdS6DfI80+55s6Xj7BFEKQW9Kh3Em0GpipHxdxiBf176xktY9EROkDkwDHlsbE7JRRQUmfmJe+0yCo+gg9uAsz5XHNrQgU5BxKhVzggMA/VU+clJ51WfbYGJAvVs/NjHQb/A9CzYKdBamUvy3YY2dxLbdohR7TZMM0JWYmZcmSiaOiZxrCT3ThlQ/J9o9r6TFWvkVjvt+ozABsx0OvtNrdkp7VvFbSQGvmTzGnPM2O5xqzWrM73Z7g8Ahw1g08FDN0JAO8n/Y0tb/xpVAFBmkQTJpQk7f4kQAHWlZKEYN2wEnX+hptjXfDjMYGX9Tc5vdDQJ3oTxnCt+y7Vl9IplT0a5GTTE0l8Pyc4=
141-
# file_glob: true
142-
# file: '*.{deb,rpm}'
143-
# on:
144-
# repo: ParallelSSH/ssh2-python
145-
# tags: true
146-
- stage: build wheels
125+
126+
- stage: build packages
127+
os: osx
128+
osx_image: xcode9.3
129+
before_install:
130+
- brew update
131+
install:
132+
- brew upgrade openssl
133+
- sudo ci/install-ssh2.sh
134+
- sudo -H pip2 install -U delocate twine wheel pip setuptools
135+
- cp /usr/local/lib/libssh2* .
136+
- ls -lh
137+
- pip2 wheel .
138+
script:
139+
- delocate-listdeps --all *.whl
140+
- delocate-wheel -v *.whl
141+
- delocate-listdeps --all *.whl
142+
- ls -l *.whl
143+
- rm -f *.dylib
144+
- pip2 install --user -v *.whl
145+
- pwd; mkdir temp; cd temp; pwd
146+
- python -c "from ssh2.session import Session; Session()"
147+
- cd ..; pwd
148+
after_success:
149+
- if [[ ! -z "$TRAVIS_TAG" ]]; then
150+
twine upload -u $PYPI_U -p $PYPI_P *.whl;
151+
fi
152+
language: generic
153+
python: skip
154+
155+
- stage: build packages
156+
env:
157+
- SYSTEM_PACKAGES=1
158+
os: linux
159+
language: generic
160+
python: skip
161+
install: skip
162+
script:
163+
- docker --version
164+
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
165+
- ./ci/docker/build-packages.sh
166+
deploy:
167+
- provider: releases
168+
skip_cleanup: true
169+
api_key:
170+
secure: i1Dr0k393wXBsCKST5ckeTPdZT+hjkikHCGgMSEkJxw+Q8m/Sgq9bbBalkJZDZDc8t0a/nE4ioEXoYO+PT9wRSpjLbjDVwRoWde5PVHaR3JviiwxULEynFLbvdJ1S2O/zRM37YMVgIIXN/2SWSXvQcQznrrvjtBoV+nZfYHX2WZQruq1nQXcPvTJPeZtCBsWaA3TwbVobnOJdb3TFxnHybN3N4gCTOkurek0V7OSMpjd1qgSzNMDIhjXKf/ZB9bcuusXo2QSnzUDJo3S6QE4FBxKohVom7z4AQ8+iRVPkkrWezBo089vzPzfZN/C5+8xQAUfZ6bVNdS6DfI80+55s6Xj7BFEKQW9Kh3Em0GpipHxdxiBf176xktY9EROkDkwDHlsbE7JRRQUmfmJe+0yCo+gg9uAsz5XHNrQgU5BxKhVzggMA/VU+clJ51WfbYGJAvVs/NjHQb/A9CzYKdBamUvy3YY2dxLbdohR7TZMM0JWYmZcmSiaOiZxrCT3ThlQ/J9o9r6TFWvkVjvt+ozABsx0OvtNrdkp7VvFbSQGvmTzGnPM2O5xqzWrM73Z7g8Ahw1g08FDN0JAO8n/Y0tb/xpVAFBmkQTJpQk7f4kQAHWlZKEYN2wEnX+hptjXfDjMYGX9Tc5vdDQJ3oTxnCt+y7Vl9IplT0a5GTTE0l8Pyc4=
171+
file_glob: true
172+
file: '*.{deb,rpm}'
173+
on:
174+
repo: ParallelSSH/ssh2-python
175+
tags: true
176+
177+
- stage: build packages
147178
os: linux
148179
python: 3.6
180+
env:
181+
- WHEELS=1
149182
install:
150183
- pip install twine
151184
script:

Changelog.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Changes
1414
Fixes
1515
------
1616

17-
* Removed duplicate definitions in ``c_ssh2.pxd``.
17+
* Removed duplicate libssh2 definitions.
18+
* Re-enabled system package releases.
19+
* System package builds would not work correctly - #25.
1820

1921

2022
0.13.0
@@ -24,7 +26,7 @@ Changes
2426
---------
2527

2628
* Upgrade embedded ``libssh2`` in binary wheels to latest version plus enhancements.
27-
* Adds support for ECDSA host keys.
29+
* Adds support for ECDSA host and client keys.
2830
* Adds support for SHA-256 host key fingerprints.
2931
* Added SSH agent forwarding implementation.
3032
* Windows wheels switched to OpenSSL back end.

ci/appveyor/fix_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def get_describe_tag():
88
return subprocess.check_output(['git', 'describe', '--tags']).strip().decode('utf-8')
99

1010
def make_version_file(basedir):
11-
# import ipdb; ipdb.set_trace()
12-
rev = os.environ['APPVEYOR_REPO_COMMIT']
11+
rev = os.environ.get('APPVEYOR_REPO_COMMIT',
12+
subprocess.check_output(['git', 'rev-list', '--max-count=1', 'HEAD']).strip().decode('utf-8'))
1313
basedir = os.path.abspath(basedir)
1414
git_desc = get_describe_tag()
1515
version_json = {'date': datetime.now().isoformat(),

ci/docker/build-packages.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ 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
15+
# docker push $docker_tag
1616
sudo rm -rf build dist
17-
docker run -v "$(pwd):/src/" "$name" --rpm-dist $dist -s python -t rpm -d libssh2 -d python setup.py
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 ssh2/*.c
22+
docker run -v "$(pwd):/src/" "$name" fpm --rpm-dist $dist -s python -t rpm -d libssh2 -d python setup.py
1823
done
1924

2025
for x in `ls -1d ci/docker/{debian,ubuntu}*`; do
@@ -23,9 +28,14 @@ for x in `ls -1d ci/docker/{debian,ubuntu}*`; do
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
31+
# docker push $docker_tag
2732
sudo rm -rf build dist
28-
docker run -v "$(pwd):/src/" "$name" --iteration $name -s python -t deb -d libssh2-1 -d python setup.py
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 ssh2/*.c
38+
docker run -v "$(pwd):/src/" "$name" fpm --iteration $name -s python -t deb -d libssh2-1 -d python setup.py
2939
done
3040

3141
sudo chown -R ${USER} *
@@ -41,3 +51,5 @@ for x in *.deb; do
4151
echo "Package: $x"
4252
dpkg-deb -c $x
4353
done
54+
55+
echo "Modified files should be reset now -- run 'git checkout -- .' to do so for all files in the repository."

ci/docker/centos6/Dockerfile

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

ci/docker/centos7/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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+
6+
ENV EMBEDDED_LIB 0
7+
ENV HAVE_AGENT_FWD 0

ci/docker/debian8/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ RUN apt-get -y update
44
RUN apt-get -y install python-setuptools python-dev libssh2-1-dev python-pip git
55
RUN pip install -U setuptools
66
RUN pip install -U pip wheel
7+
8+
ENV EMBEDDED_LIB 1
9+
ENV HAVE_AGENT_FWD 0

ci/docker/fedora22/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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+
6+
ENV EMBEDDED_LIB 0
7+
ENV HAVE_AGENT_FWD 0

ci/docker/fedora23/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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+
6+
ENV EMBEDDED_LIB 0
7+
ENV HAVE_AGENT_FWD 0

ci/docker/fedora24/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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+
6+
ENV EMBEDDED_LIB 1
7+
ENV HAVE_AGENT_FWD 0

0 commit comments

Comments
 (0)