fix: build
This commit is contained in:
49
build.sh
49
build.sh
@@ -2,6 +2,8 @@
|
||||
|
||||
ProcList="restagent crontask sshsvc captrace data2html"
|
||||
ProjectL=omc
|
||||
ProjectU=OMC
|
||||
PROJECT=${ProjectL}
|
||||
VERSION=2.2403.1
|
||||
RelDate=`date +%Y%m%d`
|
||||
Release=${RelDate}
|
||||
@@ -49,7 +51,7 @@ CapTraceBin=captrace
|
||||
Data2htmlBin=data2html
|
||||
NBI_ALARM=nbi_alarm
|
||||
NBI_AGENT=nbi_agent
|
||||
4A_AGENT=4a_agent
|
||||
AAAA_AGENT=4a_agent
|
||||
RestagentDir=${EmsBEDir}/${RESTAGENT}
|
||||
CrontaskDir=${EmsBEDir}/${CRONTASK}
|
||||
SshSvcDir=${EmsBEDir}/${SshSvcBin}
|
||||
@@ -64,15 +66,6 @@ CrontaskSize=27788951
|
||||
RestagentSize=29525312
|
||||
BinWriterDir=${HOME}/bin
|
||||
|
||||
if [[ ${shell grep VERSION_ID /etc/os-release} =~ VERSION_ID="22.04" ]]; then
|
||||
DebBuildDir :=${DebBuild2204Dir}
|
||||
DebFEBuildDir :=${DebFEBuild2204Dir}
|
||||
#DebPkgFile :=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
|
||||
DebPkgFile :=${PROJECT}-r${VERSION}-${Release}-ub22.deb
|
||||
elif [[ ${shell grep VERSION_ID /etc/os-release} =~ VERSION_ID="18.04" ]]; then
|
||||
DebPkgFile :=${PROJECT}-r${VERSION}-${Release}-ub18.deb
|
||||
fi
|
||||
|
||||
if [[ ${RpmArch} =~ "x86_64" ]];then
|
||||
RelArch=amd64
|
||||
elif [[ ${RpmArch} =~ "aarch64" ]];then
|
||||
@@ -87,11 +80,11 @@ for procName in $ProcList;do
|
||||
done
|
||||
|
||||
#Get SQL from database
|
||||
if [ "$2"="db" ]; then
|
||||
cd ${DumpToolDir}
|
||||
chmod +x ${DumpToolDir}/dumpdb.sh
|
||||
${DumpToolDir}/dumpdb.sh
|
||||
fi
|
||||
#if [ "$2"="db" ]; then
|
||||
# cd ${DumpToolDir}
|
||||
# chmod +x ${DumpToolDir}/dumpdb.sh
|
||||
# ${DumpToolDir}/dumpdb.sh
|
||||
#fi
|
||||
|
||||
case "$1" in
|
||||
rpm)
|
||||
@@ -104,7 +97,20 @@ case "$1" in
|
||||
md5sum $RpmPkgRename >omc-md5sum.txt
|
||||
;;
|
||||
deb)
|
||||
cd $EmsBEDir
|
||||
VersionID=`grep VERSION_ID /etc/os-release`
|
||||
if [[ ${VersionID} =~ 'VERSION_ID="22.04"' ]]; then
|
||||
DebBuildDir=${DebBuild2204Dir}
|
||||
DebFEBuildDir=${DebFEBuild2204Dir}
|
||||
#DebPkgFile=${PROJECT}-${VERSION}-22.04-${Release).${PLATFORM).deb
|
||||
DebPkgFile=${PROJECT}-r${VERSION}-${Release}-ub22.deb
|
||||
elif [[ ${VersionID} =~ 'VERSION_ID="18.04"' ]]; then
|
||||
DebPkgFile=${PROJECT}-r${VERSION}-${Release}-ub18.deb
|
||||
else
|
||||
echo "Invalid OS release: ${VersionID}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${EmsBEDir}
|
||||
|
||||
#make deb
|
||||
# clear build cache
|
||||
@@ -123,6 +129,12 @@ case "$1" in
|
||||
cp -rf ${DBSQLSrcDir}/* ${BuildOMCEtcDir}/db/
|
||||
cp -rf ${ConfigSystemdDir}/* ${BuildLibSystemDir}
|
||||
cp -rf ${EmsFEVue3Dir}/* ${FrontBuildDir}/front >/dev/null
|
||||
#Get SQL from database
|
||||
if [ "$2" = "db" ]; then
|
||||
cd ${DumpToolDir}
|
||||
chmod +x ${DumpToolDir}/dumpsql.sh
|
||||
${DumpToolDir}/dumpsql.sh
|
||||
fi
|
||||
chmod 755 ${BuildOMCBinDir}/*
|
||||
chmod 755 ${DebBuildDir}/DEBIAN/preinst
|
||||
chmod 755 ${DebBuildDir}/DEBIAN/postinst
|
||||
@@ -131,8 +143,7 @@ case "$1" in
|
||||
#cp -rf ${BuildDir}/nginx/* ${DebBuildDir}/etc/nginx/conf.d
|
||||
#cp -rf ${BuildDir}/systemd/*.service ${DebBuildDir}/lib/systemd/system/
|
||||
chmod +x ${DebBuildDir}/usr/local/omc/bin/*
|
||||
#sed -i.bak 's/YYYYMMDD/${shell date +"%Y%m%d"}/g' ${DebBuildDir}/DEBIAN/control
|
||||
sed -i 's/YYYYMMDD/${shell date +"%Y%m%d"}/g' ${DebBuildDir}/DEBIAN/control
|
||||
sed -i 's/YYYYMMDD/${RelDate}/g' ${DebBuildDir}/DEBIAN/control
|
||||
perl -0777 -i -pe 's/ne:\n user: root/ne:\n user: agtuser/g' ${DebBuildDir}/usr/local/omc/etc/default/restconf.yaml
|
||||
dpkg -b ${DebBuildDir} ${ReleaseDebs}/${DebPkgFile}
|
||||
|
||||
@@ -145,4 +156,4 @@ case "$1" in
|
||||
echo "mkpkg"
|
||||
echo "Usage: $0 rpm|deb"
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user