1
0
Fork 0
mirror of https://gitlab.com/niansa/simpsh-httpd.git synced 2025-03-06 20:53:36 +01:00
simpsh-httpd/ci-test.sh
2020-08-02 22:24:46 +02:00

21 lines
No EOL
809 B
Bash
Executable file

alias git='"true" ' &&
echo "Installing depencies..." &&
apt update -qq &&
apt install -qq -y fakeroot curl &&
echo "Building Debian package..." &&
mkdir /tmp/simpsh-httpd &&
mv ./* /tmp/simpsh-httpd/ &&
mv ./.git /tmp/simpsh-httpd/ &&
export HOME="/tmp/" &&
cd &&
chmod -R a+x ./simpsh-httpd &&
./simpsh-httpd/mkdeb.sh &&
apt -y install ./simpsh-httpd.deb &&
echo "Starting simpsh-httpd..." &&
mkdir -p /var/www/html &&
simpsh-httpd-socat -d &&
echo "Creating test document..." &&
(echo "This is a test!" > /var/www/html/testdocument.txt) &&
echo "Loading test document from server..."
testdoc="$(curl http://localhost:8888/testdocument.txt)" &&
(if [[ $testdoc == "This is a test!" ]]; then echo "Server returned expected document"; else echo "Something went wrong... Server returned: $testdoc"; exit 1; fi)