Add possibility to modify process of plugin build
End user can now set environment variables which modify process of building plugin, for example user can decide to include all dependencies inside plugin package. Change-Id: I628d57408ebd18d5428f662a080e47135282a12d
This commit is contained in:
parent
81083c7c89
commit
c0ee7ad838
16
README.md
16
README.md
|
@ -89,12 +89,28 @@ OpenDaylight plugin configuration
|
|||
|
||||
![OpenDaylight options](./figures/opendaylight-options.png "OpenDaylight options")
|
||||
|
||||
Build options
|
||||
-------------
|
||||
|
||||
It is possible to modify process of building plugin by setting environment variables. Look into [pre_build_hook file](pre_build_hook) for more details.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
OpenDaylight controller require Java Runtime Environment. In case of CentOS system it is required to point
|
||||
repository where java rpm package can be found. It can be done in Settings tab in Repositories section.
|
||||
It is important to assign highest priority to mos repositories (lower number is a higher priority).
|
||||
|
||||
![OpenDaylight repositories](./figures/opendaylight-repositories.png "OpenDaylight repositories")
|
||||
|
||||
If you plan to use plugin in environment without internet access modify build command:
|
||||
|
||||
INCLUDE_DEPENDENCIES=true fpb --build fuel-plugin-opendaylight/
|
||||
|
||||
Pre build script will try download required dependencies so it become part of the compiled plugin.
|
||||
|
||||
Note: List of packages for [ubuntu](odl_package/ubuntu/dependencies.txt) and [centos](odl_package/centos/dependencies.txt) may need to be modified if packages in centos or ubuntu repositories will change.
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
http://mirror.centos.org/centos/6/os/x86_64/Packages/java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/gdk-pixbuf2-2.24.1-5.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/sgml-common-0.6.3-33.el6.noarch.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/GConf2-2.28.0-6.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/ORBit2-2.14.17-5.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/ttmkfdir-3.0.9-32.1.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/libIDL-0.8.13-2.1.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/jpackage-utils-1.7.5-3.14.el6.noarch.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/tzdata-java-2015e-1.el6.noarch.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/xorg-x11-fonts-Type1-7.2-11.el6.noarch.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64/Packages/giflib-4.1.6-3.1.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64//Packages/gtk2-2.24.23-6.el6.x86_64.rpm
|
||||
http://mirror.centos.org/centos/6/os/x86_64//Packages/glib2-2.28.8-4.el6.x86_64.rpm
|
|
@ -0,0 +1,25 @@
|
|||
http://archive.ubuntu.com/ubuntu/pool/main/liba/libasyncns/libasyncns0_0.8-4ubuntu2_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-common-data_0.6.31-4ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-common3_0.6.31-4ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/libavahi-client3_0.6.31-4ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/c/cups/libcups2_1.7.2-0ubuntu1.6_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libo/libogg/libogg0_1.3.1-1ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/flac/libflac8_1.3.0-2ubuntu0.14.04.1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu-core_2.34-1ubuntu1_all.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig-config_2.11.0-0ubuntu4.1_all.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/libfontconfig1_2.11.0-0ubuntu4.1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_1.3.0-0ubuntu2_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/l/lcms2/liblcms2-2_2.5-0ubuntu4_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/n/nspr/libnspr4_4.10.7-0ubuntu0.14.04.1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3-nssdb_3.19.2-0ubuntu0.14.04.1_all.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/n/nss/libnss3_3.19.2-0ubuntu0.14.04.1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/pcsc-lite/libpcsclite1_1.8.10-1ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libv/libvorbis/libvorbis0a_1.3.2-1.3ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libv/libvorbis/libvorbisenc2_1.3.2-1.3ubuntu1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libs/libsndfile/libsndfile1_1.0.25-7ubuntu2_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/pulseaudio/libpulse0_4.0-0ubuntu11.1_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/c/ca-certificates-java/ca-certificates-java_20130815ubuntu1_all.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata-java_2015f-0ubuntu0.14.04_all.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/j/java-common/java-common_0.51_all.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libj/libjpeg8-empty/libjpeg8_8c-2ubuntu8_amd64.deb
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u79-2.5.6-0ubuntu1.14.04.1_amd64.deb
|
|
@ -7,19 +7,26 @@ set -eux
|
|||
|
||||
# Where we can find odl karaf distribution tarball
|
||||
# can be http(s) url or absolute path
|
||||
ODL_TARBALL_LOCATION="https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.3.1-Lithium-SR1/distribution-karaf-0.3.1-Lithium-SR1.tar.gz"
|
||||
ODL_TARBALL_LOCATION=${ODL_TARBALL_LOCATION:-https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.3.1-Lithium-SR1/distribution-karaf-0.3.1-Lithium-SR1.tar.gz}
|
||||
|
||||
#Verion number used in deb/rpm package
|
||||
ODL_VERSION_NUMBER="0.3.1"
|
||||
ODL_VERSION_NUMBER=${ODL_VERSION_NUMBER:-0.3.1}
|
||||
ODL_DESCRIPTION="OpenDaylight SDN Controller"
|
||||
TMP_NAME="karaf-odl.tar.gz"
|
||||
|
||||
# For which systems odl package should be build
|
||||
BUILD_FOR="centos ubuntu"
|
||||
BUILD_FOR=${BUILD_FOR:-centos ubuntu}
|
||||
|
||||
DIR="$(dirname `readlink -f $0`)"
|
||||
MODULES="${DIR}/deployment_scripts/puppet/modules"
|
||||
|
||||
# If true java and it dependencies will be part of the plugin.
|
||||
# Useful for offline deployments.
|
||||
INCLUDE_DEPENDENCIES=${INCLUDE_DEPENDENCIES:-false}
|
||||
|
||||
# Patch ODL to use br-floating as external bridge
|
||||
USE_FUEL_PATCH=${USE_FUEL_PATCH:-true}
|
||||
|
||||
function cleanup {
|
||||
rm -f "${DIR}/${TMP_NAME}"
|
||||
rm -rf "${DIR}/package"
|
||||
|
@ -37,16 +44,29 @@ function patch_odl {
|
|||
cp "${DIR}/odl_package/odl_lithium_patch/openstack.net-virt-1.1.1-Lithium-SR1.jar" "${DIR}/package/system/org/opendaylight/ovsdb/openstack.net-virt/1.1.1-Lithium-SR1/openstack.net-virt-1.1.1-Lithium-SR1.jar"
|
||||
}
|
||||
|
||||
# Download packages required by ODL.
|
||||
# List generated with commands:
|
||||
# yumdownloader --urls --resolve java-1.7.0-openjdk
|
||||
# apt-get --print-uris --yes install openjdk-7-jre-headless | grep ^\' | cut -d\' -f2 >downloads.list
|
||||
function download_dependencies {
|
||||
if [ "$INCLUDE_DEPENDENCIES" = true ]
|
||||
then
|
||||
wget -N -i "${DIR}/odl_package/${1}/dependencies.txt"
|
||||
fi
|
||||
}
|
||||
|
||||
function build_pkg {
|
||||
case $1 in
|
||||
centos)
|
||||
pushd "${DIR}/repositories/${1}/"
|
||||
fpm --force -s dir -t rpm --version "${ODL_VERSION_NUMBER}" --description "${ODL_DESCRIPTION}" --prefix /opt/opendaylight --rpm-init "${DIR}/odl_package/${1}/opendaylight" --after-install "${DIR}/odl_package/${1}/opendaylight-post" --name opendaylight -d "java-1.7.0-openjdk" -C "${DIR}/package"
|
||||
download_dependencies ${1}
|
||||
popd
|
||||
;;
|
||||
ubuntu)
|
||||
pushd "${DIR}/repositories/${1}/"
|
||||
fpm --force -s dir -t deb --version "${ODL_VERSION_NUMBER}" --description "${ODL_DESCRIPTION}" --prefix /opt/opendaylight --deb-upstart "${DIR}/odl_package/${1}/opendaylight" --after-install "${DIR}/odl_package/${1}/opendaylight-post" --name opendaylight -d "openjdk-7-jre-headless" -C "${DIR}/package"
|
||||
download_dependencies ${1}
|
||||
popd
|
||||
;;
|
||||
*) echo "Not supported system"; exit 1;;
|
||||
|
@ -67,7 +87,10 @@ else
|
|||
unpack $ODL_TARBALL_LOCATION
|
||||
fi
|
||||
|
||||
patch_odl
|
||||
if [ "$USE_FUEL_PATCH" = true ]
|
||||
then
|
||||
patch_odl
|
||||
fi
|
||||
|
||||
for system in $BUILD_FOR
|
||||
do
|
||||
|
|
Loading…
Reference in New Issue