summaryrefslogtreecommitdiffstats
path: root/ci/build_rpm/build_rpms_docker.sh
diff options
context:
space:
mode:
authorzeyu zhu <zhu.zeyu@zte.com.cn>2016-11-29 20:09:59 +0800
committerzeyu zhu <zhu.zeyu@zte.com.cn>2016-12-14 14:28:24 +0800
commit04a66a586cc90b2be310d2323d526e11c95ab258 (patch)
tree528422e0b41e9c853b9fb76ebb50959d219822eb /ci/build_rpm/build_rpms_docker.sh
parent6963d16b32f0c40ea45be66bbd189d2d5bb070fb (diff)
Implement of build script in Escalator
Change-Id: I1296eec05c59f253ee5ce73d2477825689997275 Signed-off-by: zeyu zhu <zhu.zeyu@zte.com.cn>
Diffstat (limited to 'ci/build_rpm/build_rpms_docker.sh')
-rwxr-xr-xci/build_rpm/build_rpms_docker.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/ci/build_rpm/build_rpms_docker.sh b/ci/build_rpm/build_rpms_docker.sh
new file mode 100755
index 0000000..9b2454d
--- /dev/null
+++ b/ci/build_rpm/build_rpms_docker.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+OPNFV_ARTIFACT_VERSION=$1
+rpm_build_dir=/opt/escalator
+rpm_output_dir=$rpm_build_dir/build_output
+tmp_rpm_build_dir=/root/escalator
+
+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"
+
+ cd api
+ python setup.py sdist
+
+ cd ..
+ cd client
+ python setup.py sdist
+
+ 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 $rpm_output_dir
+mkdir upload_artifacts
+cp api/dist/escalator-* $rpm_output_dir/upload_artifacts
+cp client/dist/escalatorclient-* $rpm_output_dir/upload_artifacts
+tar zcvf opnfv-$OPNFV_ARTIFACT_VERSION.tar.gz upload_artifacts
+exit $rc