add build script for daisy4nfv 53/23053/7
authorJing Sun <sun.jing22@zte.com.cn>
Thu, 13 Oct 2016 14:30:39 +0000 (10:30 -0400)
committerJing Sun <sun.jing22@zte.com.cn>
Fri, 14 Oct 2016 07:22:13 +0000 (07:22 +0000)
Change-Id: I53daa25a87f04b2e0d4988d095a8d99535489dac
Signed-off-by: Jing Sun <sun.jing22@zte.com.cn>
ci/build.sh [new file with mode: 0644]
ci/build_rpm/Dockerfile [new file with mode: 0644]
ci/build_rpm/build_rpms.sh [new file with mode: 0644]
ci/build_rpm/build_rpms_docker.sh [new file with mode: 0644]
ci/build_rpm/daisy_rpm_build.sh [new file with mode: 0644]

diff --git a/ci/build.sh b/ci/build.sh
new file mode 100644 (file)
index 0000000..8d71d93
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+DAISYDIR = $1
+cd ci/build_rpm
+./build_rpms.sh DAISYDIR
+
+
diff --git a/ci/build_rpm/Dockerfile b/ci/build_rpm/Dockerfile
new file mode 100644 (file)
index 0000000..b46be32
--- /dev/null
@@ -0,0 +1,47 @@
+FROM centos
+
+RUN yum -y update
+RUN yum -y install centos-release-openstack-mitaka
+RUN yum -y install \
+  coreutils \
+  git \
+  intltool \
+  make \
+  rpm \
+  rpm-build \
+  python-sphinx \
+  python-XStatic-Angular \
+  python-XStatic-Angular-Bootstrap \
+  python-XStatic-Angular-lrdragndrop \
+  python-XStatic-Angular-Mock \
+  python-XStatic-Bootstrap-Datepicker \
+  python-XStatic-Bootstrap-SCSS \
+  python-XStatic-D3 \
+  python-XStatic-Font-Awesome \
+  python-XStatic-Hogan \
+  python-XStatic-Jasmine \
+  python-XStatic-jQuery \
+  python-XStatic-JQuery-Migrate \
+  python-XStatic-JQuery-quicksearch \
+  python-XStatic-JQuery-TableSorter \
+  python-XStatic-jquery-ui \
+  python-XStatic-JSEncrypt \
+  python-XStatic-Magic-Search \
+  python-XStatic-QUnit \
+  python-XStatic-Rickshaw \
+  python-XStatic-smart-table \
+  python-XStatic-Spin \
+  python-XStatic-termjs \
+  python2-oslo-sphinx \
+  python2-oslo-messaging \
+  python2-oslo-concurrency \
+  python2-oslo-sphinx \
+  python-devel \
+  python-d2to1 \
+  python-django-compressor \
+  python-django-openstack-auth \
+  python-django-pyscss \
+  python-lesscpy \
+  python-migrate \
+  python-pint \
+  python-routes
\ No newline at end of file
diff --git a/ci/build_rpm/build_rpms.sh b/ci/build_rpm/build_rpms.sh
new file mode 100644 (file)
index 0000000..cb31d00
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+set -eux
+DAISYDIR = $1
+function build_rpm_pkg {
+      sudo docker build -t daisy4nfv_rpm .
+      sudo docker run -v DAISYDIR:/opt/daisy4nfv -t  daisy4nfv_rpm \
+                      /opt/daisy4nfv/ci/build_rpm/build_rpms_docker.sh
+}
+
+build_rpm_pkg
diff --git a/ci/build_rpm/build_rpms_docker.sh b/ci/build_rpm/build_rpms_docker.sh
new file mode 100644 (file)
index 0000000..813d3ff
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+tmp_rpm_build_dir=/root/daisy4nfv
+rpm_build_dir=/opt/daisy4nfv
+tmp_rpm_output_dir=$tmp_rpm_build_dir/build_output
+rpm_output_dir=$rpm_build_dir/build_output
+cp -r $rpm_build_dir $tmp_rpm_build_dir
+
+# Build daisy rpm packages
+cd $tmp_rpm_build_dir/
+make clean
+./ci/build_rpm/daisy_rpm_build.sh build_output
+
+
+# Move daisy bin file from tmp_output_dir to output_dir
+mv $tmp_rpm_output_dir/installdaisy_el7_noarch.bin $rpm_output_dir
diff --git a/ci/build_rpm/daisy_rpm_build.sh b/ci/build_rpm/daisy_rpm_build.sh
new file mode 100644 (file)
index 0000000..a9c2404
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Coreporation and others.
+# hu.zhijiang@zte.com.cn
+# sun.jing22@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+output_dir = "$1"
+
+echo "#########################################################"
+echo "               systemctl info:                   "
+echo "#########################################################"
+echo "###Uname:"
+uname
+echo "###Hostname:"
+hostname
+
+
+maxcount=3
+cnt=0
+rc=1
+while [ $cnt -lt $maxcount ] && [ $rc -ne 0 ]
+do
+    cnt=$[cnt + 1]
+    echo -e "\n\n\n*** Starting build attempt # $cnt"
+
+    mkdir daisy-dir
+    cd daisy-dir
+    git clone https://git.openstack.org/openstack/daisycloud-core
+    cd daisycloud-core/tools
+    make allrpm
+
+    echo "######################################################"
+    echo "          done              "
+    echo "######################################################"
+    rc=$?
+    if [ $rc -ne 0 ]; then
+        echo "### Build failed with rc $rc ###"
+    else
+        echo "### Build successful at attempt # $cnt"
+    fi
+done
+cd daisy-dir
+mv daisycloud-core/target/el7/noarch/installdaisy_el7_noarch.bin output_dir
+exit $rc