Skip to content

Commit 16bd4cf

Browse files
committed
Adding files to build a f5-sdk Debian package
1 parent effa4f2 commit 16bd4cf

5 files changed

Lines changed: 38 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*.py[cod]
88

99
### added with RM's Makefile
10-
**/deb_dist/**
10+
deb_dist/**
1111
localutils/**
1212
agent/f5/bigip/pycontrol/wsdl/**
1313

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Dockerfile
2+
FROM ubuntu:trusty
3+
4+
RUN apt-get update && apt-get install -y \
5+
python-stdeb \
6+
fakeroot \
7+
python-all
8+
9+
COPY ./build-debs.sh /
10+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -ex
2+
3+
SRC_DIR=$1
4+
pushd $SRC_DIR
5+
PKG_VERSION=$(python -c "import f5; print(f5.__version__)")
6+
7+
PKG_NAME="f5-sdk"
8+
9+
TMP_DIST="/var/deb_dist"
10+
OS_VERSION="1404"
11+
DIST_DIR="f5-sdk-dist/deb_dist"
12+
13+
echo "Building ${PKG_NAME} debian packages..."
14+
15+
cp -R "${SRC_DIR}/${DIST_DIR}/stdeb.cfg" .
16+
cp -R "${SRC_DIR}/${DIST_DIR}" ${TMP_DIST}
17+
18+
python setup.py --command-packages=stdeb.command sdist_dsc --dist-dir=${TMP_DIST}
19+
pushd "${TMP_DIST}/${PKG_NAME}-${PKG_VERSION}"
20+
dpkg-buildpackage -rfakeroot -uc -us
21+
popd; popd
22+
23+
pkg="python-${PKG_NAME}_${PKG_VERSION}-1_all.deb"
24+
cp "${TMP_DIST}/${pkg}" "${SRC_DIR}/${DIST_DIR}/${pkg%%_all.deb}_${OS_VERSION}_all.deb"

f5-sdk-dist/deb_dist/stdeb.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[DEFAULT]
2+
Depends:
3+
python-f5-icontrol-rest (>=1.0.7)

f5-sdk-dist/scripts/package.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ fi
1919

2020
docker build -t ${BUILD_CONTAINER} ${DIST_DIR}/Docker/${OS_TYPE}/${OS_VERSION}
2121
docker run --privileged --rm -v $(pwd):${WORKING_DIR} ${BUILD_CONTAINER} /bin/bash /build-${PKG_TYPE}.sh "${WORKING_DIR}"
22-
sudo chown -R travis:travis ${DIST_DIR}
2322

2423
exit 0

0 commit comments

Comments
 (0)