Build collectd in ubuntu 16.04 docker 95/25395/3
authorGuo Ruijing <ruijing.guo@intel.com>
Thu, 1 Dec 2016 22:43:35 +0000 (17:43 -0500)
committerGuo Ruijing <ruijing.guo@intel.com>
Mon, 12 Dec 2016 18:44:43 +0000 (10:44 -0800)
Change-Id: Icd74de46b2ca61eb4e5137a2af4448f52750d7f8
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
src/fuel-plugin/Dockerfile [new file with mode: 0644]
src/fuel-plugin/build-collectd.sh
src/fuel-plugin/deployment_scripts/install.sh
src/fuel-plugin/pre_build_hook
src/fuel-plugin/vagrant/build_fuel_plugin.sh

diff --git a/src/fuel-plugin/Dockerfile b/src/fuel-plugin/Dockerfile
new file mode 100644 (file)
index 0000000..301d796
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+FROM ubuntu:16.04
+
+RUN apt-get update -y
+RUN apt-get install -y sudo
+
+ADD ./build-collectd.sh /build-collectd.sh
index 3eefa63..0ef3136 100755 (executable)
@@ -64,8 +64,8 @@ sudo apt-get -y install \
 
 cd ${BUILD_HOME}
 rm -rf collectd
-git clone https://github.com/collectd/collectd; cd collectd; git checkout 8acc85b
-git clone https://github.com/collectd/pkg-debian; cd pkg-debian; git checkout e5972da
+git clone https://github.com/collectd/collectd; cd collectd; git checkout 797ed5e5bee9ee89361f12e447ffc6ceb6ef79d2
+git clone https://github.com/collectd/pkg-debian; cd pkg-debian; git checkout 549d3caba74210ad762fe8c556801d9c11ab9876
 mv debian ..
 
 cd ${BUILD_HOME}/collectd
@@ -73,3 +73,4 @@ cd ${BUILD_HOME}/collectd
 debian/rules build || true
 debian/rules build
 fakeroot debian/rules binary
+cp ${BUILD_HOME}/*.deb /build
index 807e568..0bcb400 100755 (executable)
@@ -11,7 +11,7 @@ OS_PASSWORD=$4
 CEILOMETER_URL_TYPE=${CEILOMETER_URL_TYPE:-internalURL}
 CEILOMETER_TIMEOUT=${CEILOMETER_TIMEOUT:-1000}
 
-apt-get install -y collectd
+apt-get install -y collectd python-dev libpython2.7
 
 rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
 cd $INSTALL_HOME
index 9a53993..c0d35d4 100755 (executable)
@@ -13,18 +13,19 @@ DIR="$(dirname `readlink -f $0`)"
 function build_pkg {
   case $1 in
     ubuntu)
+      cd ${DIR}
       rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu
-      rm -rf ${DIR}/build; mkdir -p ${DIR}/build; cd ${DIR}/build;
+      rm -rf collectd-ceilometer-plugin
       git clone https://github.com/openstack/collectd-ceilometer-plugin
       cd  collectd-ceilometer-plugin
-      git checkout 73372f2eb86c81f12bc10b392f75050a401107db 
+      git checkout 73372f2eb86c81f12bc10b392f75050a401107db
       tar cfvz ${DIR}/repositories/ubuntu/collectd-ceilometer.tgz . --exclude=collectd-ceilometer.tgz
+      cd ..; rm -rf collectd-ceilometer-plugin
 
-      # support collectd with dpdk
-      cd ${DIR}/build; ../build-collectd.sh
-      cp *.deb ${DIR}/repositories/ubuntu
-
-      rm -rf ${DIR}/build
+      # build collectd
+      cd ${DIR}
+      sudo docker  build -t collectd_build .
+      sudo docker run -v${DIR}/repositories/ubuntu:/build -t collectd_build /build-collectd.sh
       ;;
     *) echo "Not supported system"; exit 1;;
   esac
index 5fdf9c3..ea77b07 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 sudo apt-get update -y
-sudo apt-get install -y ruby-dev rubygems-integration python-pip rpm createrepo dpkg-dev git
+sudo apt-get install -y ruby-dev rubygems-integration python-pip rpm createrepo dpkg-dev git docker.io
 sudo gem install fpm
 sudo pip install fuel-plugin-builder
 cp -r /fuel-plugin /home/vagrant