add patch of openstack/daisycloud 39/23639/24
authorYao Lu <lu.yao135@zte.com.cn>
Tue, 25 Oct 2016 01:04:16 +0000 (09:04 +0800)
committerYao Lu <lu.yao135@zte.com.cn>
Thu, 3 Nov 2016 02:46:06 +0000 (10:46 +0800)
the patch is about integrate kolla tar and tgz and centos to daisy bin
and cp to appoint path

Change-Id: I3043d2a38f15cdff44f9c777bff8bb5e517684bd
Signed-off-by: Yao Lu <lu.yao135@zte.com.cn>
ci/build_rpm/Dockerfile
ci/build_rpm/build_rpms_docker.sh
code/install_interface_patch.sh [new file with mode: 0755]
code/makefile_patch.sh [new file with mode: 0755]

index 63ad0cb..77aa1a3 100644 (file)
@@ -44,4 +44,5 @@ RUN yum -y install \
   python-lesscpy \
   python-migrate \
   python-pint \
-  python-routes
+  python-routes \
+  coreutils
index 7313d57..8b5c409 100755 (executable)
@@ -9,4 +9,43 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 
-# Implement build (call make allrpm) here
+rpm_build_dir=/opt/daisy4nfv
+rpm_output_dir=$rpm_build_dir/build_output
+tmp_rpm_build_dir=/root/daisy4nfv
+
+cp -r $rpm_build_dir $tmp_rpm_build_dir
+cd $tmp_rpm_build_dir
+
+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"
+
+    git clone https://git.openstack.org/openstack/daisycloud-core
+    cp $tmp_rpm_build_dir/code/makefile_patch.sh daisycloud-core/tools/setup
+    cp $tmp_rpm_build_dir/code/install_interface_patch.sh daisycloud-core/tools/setup
+    cd daisycloud-core/make
+    make allrpm
+    rc=$?
+
+    echo "######################################################"
+    echo "          done              "
+    echo "######################################################"
+    if [ $rc -ne 0 ]; then
+        echo "### Build failed with rc $rc ###"
+    else
+        echo "### Build successfully at attempt # $cnt"
+    fi
+done
+cd ..
+cp target/el7/noarch/installdaisy_el7_noarch.bin $rpm_output_dir
+exit $rc
diff --git a/code/install_interface_patch.sh b/code/install_interface_patch.sh
new file mode 100755 (executable)
index 0000000..e0ac087
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Corporation and others.
+# hu.zhijiang@zte.com.cn
+# lu.yao135@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
+##############################################################################
+mkdir -p /home/kolla_install/docker
+if [ ! -e "/home/kolla_install/docker/registry-mitaka-latest.tgz" ];then
+    cp registry-mitaka-latest.tgz /home/kolla_install/docker
+fi
+if [ ! -e "/home/kolla_install/docker/registry-server.tar" ];then
+    cp registry-server.tar /home/kolla_install/docker
+fi
+cp CentOS-7-x86_64-Minimal-1511.iso /var/lib/daisy/kolla
+
diff --git a/code/makefile_patch.sh b/code/makefile_patch.sh
new file mode 100755 (executable)
index 0000000..afcc4c1
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2016 ZTE Corporation and others.
+# hu.zhijiang@zte.com.cn
+# lu.yao135@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
+##############################################################################
+TOOLS_PATH=$1
+CACHE_PATH=/home/cache
+if [ ! -d $CACHE_PATH ]; then mkdir -p $CACHE_PATH ; fi
+if [ ! -f $CACHE_PATH/CentOS-7-x86_64-Minimal-1511.iso ]; then
+    wget -P $CACHE_PATH "http://mirrors.163.com/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso"
+fi
+if [ ! -f $CACHE_PATH/registry-2.0.3.tgz ]; then
+    wget -P $CACHE_PATH "ftp://openuser:123@120.76.145.166/registry-mitaka-latest.tgz"
+fi
+if [ ! -f $CACHE_PATH/registry-server.tar ]; then
+    wget -P $CACHE_PATH "ftp://openuser:123@120.76.145.166/registry-server.tar"
+fi
+cp $CACHE_PATH/CentOS-7-x86_64-Minimal-1511.iso $TOOLS_PATH/setup/bin_temp/
+cp $CACHE_PATH/registry-2.0.3.tgz $TOOLS_PATH/setup/bin_temp/
+cp $CACHE_PATH/registry-server.tar $TOOLS_PATH/setup/bin_temp/
+cp $TOOLS_PATH/setup/install_interface_patch.sh $TOOLS_PATH/setup/bin_temp/
+chmod +x $TOOLS_PATH/setup/bin_temp/install_interface_patch.sh