forked from intel/virtual-storage-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsm-deploy
executable file
·40 lines (31 loc) · 1.26 KB
/
vsm-deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function _install_vsmdeploy_dep_package() {
sudo yum install -y rpm-build
}
function _setup_vsmdeploy_rpm() {
rm -rf $TEMP/*
local old_dir=`pwd`
local version=`cat VERSION`
cp -rf $TOPDIR/$SOURCE_DIR/$VSM_DEPLOY_DIR $TEMP/
rm -rf $TOPDIR/$SOURCE_DIR/$VSM_DEPLOY_DIR/tools/etc/vsm
cp -rf $TOPDIR/$SOURCE_DIR/$VSM_DIR/etc/vsm $TOPDIR/$SOURCE_DIR/$VSM_DEPLOY_DIR/tools/etc/
rm -rf $TOPDIR/$SOURCE_DIR/$VSM_DEPLOY_DIR/tools/etc/vsm-dashboard/*
local FROM_DIR=$TOPDIR/source/vsm-dashboard/vsm_dashboard/
local TO_DIR=$TOPDIR/source/vsm-deploy/tools/etc/vsm-dashboard/
cp -rf $FROM_DIR/local/local_settings.template $TO_DIR/
cp -rf $FROM_DIR/settings.py $TO_DIR/
cp -rf $FROM_DIR/../tools/vsm-dashboard.conf $TO_DIR/
cd $TEMP/
if [[ $VSM_DEPLOY_DIR != vsm-deploy-$version ]]; then
mv $VSM_DEPLOY_DIR vsm-deploy-$version
fi
tar zcf vsm-deploy-${version}.tar.gz vsm-deploy-$version
cp -rf vsm-deploy-${version}.tar.gz ~/rpmbuild/SOURCES/
cp -rf vsm-deploy-$version/vsm-deploy.spec ~/rpmbuild/SPECS/
_install_vsmdeploy_dep_package vsm-deploy-$version/vsm-deploy.spec
cd ~/rpmbuild/SPECS/
rpmbuild -bb vsm-deploy.spec
cd $old_dir
}
function build_vsmdeploy_rpm() {
_setup_vsmdeploy_rpm
}