bbfdm/gitlab-ci/generate_supported_dm.sh
Vivek Kumar Dutta 63fad00eee Multiple improvements
- New input daemon option, 'service_name' to easily configure micro-service
- service_name used with 'dm_' prefix in process name
- service_name with 'dm_' prefix and '_inst' suffix for forked instance updater
- Unified signal handler for micro-service and main process
- Cli argument '-m' overloaded to support module name in place of plugin path
- Test alignments and improvements
2024-04-15 13:46:49 +00:00

43 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
echo "Generate xml and xls artifacts"
source ./gitlab-ci/shared.sh
# install required packages
exec_cmd apt update
exec_cmd apt install -y python3-pip libxml2-utils
exec_cmd pip3 install xlwt
if [ -n "${CI_SERVER_HOST}" ]; then
echo "machine ${CI_SERVER_HOST}" >>~/.netrc
echo "login gitlab-ci-token" >>~/.netrc
echo "password ${CI_JOB_TOKEN}" >>~/.netrc
fi
# Make sure that all plugins are removed
[ ! -d "${BBFDM_PLUGIN_DIR}" ] && mkdir -p "${BBFDM_PLUGIN_DIR}"
rm -f ${BBFDM_PLUGIN_DIR}/*
if [ -z "${1}" ]; then
./tools/generate_dm.py tools/tools_input.json
else
if [ ! -f "${1}" ]; then
echo "Invalid input file ${1}"
else
./tools/generate_dm.py "${1}"
fi
fi
check_ret $?
echo "Check if the required tools are generated"
[ ! -f "out/datamodel.xls" ] && echo "Excel file doesn't exist" && exit 1
[ ! -f "out/datamodel_hdm.xml" ] && echo "XML file with HDM format doesn't exist" && exit 1
[ ! -f "out/datamodel_default.xml" ] && echo "XML file with BBF format doesn't exist" && exit 1
echo "Validate datamodel_default generated XML file"
xmllint --schema test/tools/cwmp-datamodel-1-8.xsd out/datamodel_default.xml --noout
check_ret $?
echo "Generation of xml and xls artifacts :: PASS"