Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue.1111.master #1113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions f5-openstack-agent-dist/Docker/ubuntu/16.04/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dockerfile
FROM ubuntu:trusty

RUN apt-get update && apt-get install -y \
python-stdeb \
fakeroot \
python-all \
dh-python \
git

COPY ./build-debs.sh /

38 changes: 38 additions & 0 deletions f5-openstack-agent-dist/Docker/ubuntu/16.04/build-debs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash -ex

SRC_DIR=$1

PKG_NAME="f5-openstack-agent"
OS_VERSION="1604"
DIST_DIR="f5-openstack-agent-dist/deb_dist"

# Change directory to the source to get package information.
pushd ${SRC_DIR}

# The version is embedded in the package.
PKG_VERSION=$(python -c "import f5_openstack_agent; print(f5_openstack_agent.__version__)")
PKG_RELEASE=$(python ./f5-openstack-agent-dist/scripts/get-version-release.py --release)

# Exit source directory
popd

# Create a temporary work directory and copy the source to it.
BUILDROOT=$(mktemp -d /tmp/${PKG_NAME}.XXXXX)
cp -R ${SRC_DIR}/* ${BUILDROOT}
pushd ${BUILDROOT}

echo "Building ${PKG_NAME} debian packages..."

# Copy the stdeb.cfg file to the current directory and add the pkg release to it.
cp -R "${SRC_DIR}/${DIST_DIR}/stdeb.cfg" .
echo "Debian-Version: ${PKG_RELEASE}" >> stdeb.cfg

# Build debian package.
python setup.py --command-packages=stdeb.command sdist_dsc
pushd "deb_dist/${PKG_NAME}-${PKG_VERSION}"
export DEB_BUILD_OPTIONS=nocheck
dpkg-buildpackage -rfakeroot -uc -us
popd

pkg="python-${PKG_NAME}_${PKG_VERSION}-${PKG_RELEASE}_all.deb"
cp "deb_dist/${pkg}" "${SRC_DIR}/${DIST_DIR}/${pkg%%_all.deb}_${OS_VERSION}_all.deb"
1 change: 1 addition & 0 deletions f5-openstack-agent-dist/deb_dist/stdeb.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[DEFAULT]
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[bdist_rpm]
requires = f5-sdk == 2.3.3