diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e4a201bfcbb17bd997c528650ffcd13e5cf735f..f3bb140d1b1aaa5cc99b94b2ed8570d35b6a3b33 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - syntax - syntax_diff + - test # ### Stage syntax @@ -49,3 +50,16 @@ syntax_diff:lint: # - echo "For more information http://www.icosaedro.it/phplint/" # - vendor/bin/phplint + +test:install: + stage: test + image: jerob/docker-ispconfig + only: + - schedules + - web + script: + - $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh + - apt-get update + - apt-get --yes install curl + - curl --insecure https://127.0.0.1:8080/login/ + - ps xaf diff --git a/helper_scripts/test_install_docker.sh b/helper_scripts/test_install_docker.sh new file mode 100755 index 0000000000000000000000000000000000000000..4de61c38957dff6ddd1ce9ae823ca93974cdcd18 --- /dev/null +++ b/helper_scripts/test_install_docker.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# This script is used from .gitlab-ci.yml to do an automated installation inside a docker container for testing. + +if [ -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then + echo "Found an existing configfile, bailing out!" + exit 1 +fi + +mysql_install_db +service mysql start \ +&& echo "UPDATE mysql.user SET Password = PASSWORD('pass') WHERE User = 'root';" | mysql -u root \ +&& echo "UPDATE mysql.user SET plugin='mysql_native_password' where user='root';" | mysql -u root \ +&& echo "DELETE FROM mysql.user WHERE User='';" | mysql -u root \ +&& echo "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" | mysql -u root \ +&& echo "DROP DATABASE IF EXISTS test;" | mysql -u root \ +&& echo "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';" | mysql -u root \ +&& echo "FLUSH PRIVILEGES;" | mysql -u root +sed -i "s/^hostname=server1.example.com$/hostname=$HOSTNAME/g" /root/ispconfig3_install/install/autoinstall.ini + +service mysql start && php -q $CI_PROJECT_DIR/install/install.php --autoinstall=/root/ispconfig3_install/install/autoinstall.ini