提交ci流程

This commit is contained in:
linxin
2023-04-27 20:06:04 +08:00
parent e98c32457c
commit 9cb1654f96
2 changed files with 48 additions and 24 deletions

View File

@@ -32,32 +32,19 @@ env | sort
: "${NO_EXCEPTION:=OFF}"
: "${NO_RTTI:=OFF}"
: "${COMPILER_IS_GNUCXX:=OFF}"
export VERSION_ID=$(./autorevision.sh -t sh -o version | grep VCS_TAG | sed 's/^.*v//g' | sed 's/"//g')
yum install -y golang
go version
mkdir -p ./rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
tar -czvf ./rpmbuild/SOURCES/coredump-tools-${VERSION_ID}.tar.gz ../coredump-tools
cp ./script/coredump.spec ./rpmbuild/SPECS
rpmbuild --define "_version ${VERSION_ID}" --define "_release release" -ba ./rpmbuild/SPECS/coredump.spec
yum install -y cligen-devel clixon-devel
if [ -n "${LIBYAML_BUILD}" ]; then
git clone https://github.com/yaml/libyaml.git
cd libyaml
sed -i 's/^add_library.*$/add_library(yaml SHARED ${SRCS})/g' CMakeLists.txt
cmake3 .
make && make install
cd ..
fi
mkdir build || true
cd build
cmake3 -DVERSION_DAILY_BUILD=$TESTING_VERSION_BUILD ..
if [ -n "${PACKAGE}" ]; then
make package
fi
ls -halt ./*.rpm
if [ -n "${UPLOAD}" ]; then
cp ~/rpm_upload_tools.py ./
python3 rpm_upload_tools.py ${PULP3_RPM_REPO_NAME} ${PULP3_RPM_DIST_NAME} *.rpm
fi
# if [ -n "${UPLOAD}" ]; then
# cp ~/rpm_upload_tools.py ./
# python3 rpm_upload_tools.py ${PULP3_RPM_REPO_NAME} ${PULP3_RPM_DIST_NAME} *.rpm
# fi

37
script/coredump.spec Normal file
View File

@@ -0,0 +1,37 @@
Name: coredump-tools
Version: {_version}
Release: {_release}
Summary: tsg's coredump handler and tools
Group: Applications/Internet
License: GPL
URL: https://git.mesalab.cn/linxin/coredump-handler
Source0: coredump-tools-{_version}.tar.gz
%define debug_package %{nil}
%description
This package contains the binary executable for coredump-handler and coredump-tool, as well as its configuration files.
%prep
%setup -q
%build
cd ./coredump-handler
go build -o coredump-handler .
cd ..
cd ./coredump-ctl
go build -o coredump-tool .
cd ..
%install
mkdir -p %{buildroot}/etc/coredump-handler
mkdir -p %{buildroot}/opt/tsg/coredump
cp ./coredump-handler/coredump-handler %{buildroot}/opt/tsg/coredump
cp ./config/config.json %{buildroot}/etc/coredump-handler
cp ./coredump-ctl/coredump-tool %{buildroot}/opt/tsg/coredump
%post
echo "export PATH=/opt/tsg/coredump:$PATH" >>~/.bashrc
%files
%defattr (-,root,root)
/etc/coredump-handler/config.json
/opt/tsg/coredump/coredump-handler
/opt/tsg/coredump/coredump-tool