mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
cleanup docker files and build/test procedure
This commit is contained in:
18
scripts/install-build-deps.sh
Executable file
18
scripts/install-build-deps.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Install build dpenedencies.
|
||||
|
||||
source /etc/os-release
|
||||
set -x
|
||||
|
||||
case $ID in
|
||||
ubuntu*)
|
||||
apt-get install -y gcc make cmake libssh-dev
|
||||
;;
|
||||
centos* | rhel*)
|
||||
dnf install -y gcc make cmake libssh-devel rpm-build
|
||||
;;
|
||||
*)
|
||||
echo "unsupported dependency install: $ID"
|
||||
exit 1
|
||||
esac
|
||||
35
scripts/test-in-container.sh
Executable file
35
scripts/test-in-container.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Run this script in docker containers. This script installs mscp from built package
|
||||
# and run test for mscp in the installed path.
|
||||
|
||||
source /etc/os-release
|
||||
script_dir=$(cd $(dirname ${0}) && pwd)
|
||||
cd $script_dir
|
||||
project_version=$(cat ../VERSION)
|
||||
arch=$(uname -p)
|
||||
|
||||
set -x
|
||||
|
||||
# install package
|
||||
case $ID in
|
||||
ubuntu*)
|
||||
pkg=mscp_${project_version}-${ID}-${VERSION_ID}-${arch}.deb
|
||||
dpkg -i ../build/$pkg
|
||||
;;
|
||||
centos* | rhel*)
|
||||
pkg=mscp_${project_version}-${ID}-${VERSION_ID}-${arch}.rpm
|
||||
rpm -iv ../build/$pkg
|
||||
;;
|
||||
*)
|
||||
echo "unsupported test platform: $ID"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
# Run sshd
|
||||
if [ ! -e /var/run/sshd.pid ]; then
|
||||
/usr/sbin/sshd
|
||||
fi
|
||||
|
||||
# Run test
|
||||
python3 -m pytest ../test -v
|
||||
Reference in New Issue
Block a user