Skip to content

Commit 9e6a611

Browse files
committed
WIP add CI test to install ispconfig in a clean container
1 parent 6dfe36d commit 9e6a611

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.gitlab-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Defines stages which are to be executed
22
stages:
33
- syntax
4+
- test
45

56
#
67
### Stage syntax
@@ -13,10 +14,25 @@ syntax:lint:
1314
only:
1415
- schedules
1516
- web
17+
- merge_requests
1618

1719
script:
1820
- composer require overtrue/phplint
1921
- echo "Syntax checking PHP files"
2022
- echo "For more information http://www.icosaedro.it/phplint/"
2123
- vendor/bin/phplint
2224

25+
26+
test:install:
27+
stage: test
28+
image: jerob/docker-ispconfig
29+
only:
30+
- schedules
31+
- web
32+
- merge_requests
33+
script:
34+
- $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh
35+
- apt-get update
36+
- apt-get --yes install curl
37+
- curl --insecure https://127.0.0.1:8080/login/
38+
- ps xaf
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
# This script is used from .gitlab-ci.yml to do an automated installation inside a docker container for testing.
4+
5+
if [ -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then
6+
echo "Found an existing configfile, bailing out!"
7+
exit 1
8+
fi
9+
10+
mysql_install_db
11+
service mysql start \
12+
&& echo "UPDATE mysql.user SET Password = PASSWORD('pass') WHERE User = 'root';" | mysql -u root \
13+
&& echo "UPDATE mysql.user SET plugin='mysql_native_password' where user='root';" | mysql -u root \
14+
&& echo "DELETE FROM mysql.user WHERE User='';" | mysql -u root \
15+
&& echo "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" | mysql -u root \
16+
&& echo "DROP DATABASE IF EXISTS test;" | mysql -u root \
17+
&& echo "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';" | mysql -u root \
18+
&& echo "FLUSH PRIVILEGES;" | mysql -u root
19+
sed -i "s/^hostname=server1.example.com$/hostname=$HOSTNAME/g" /root/ispconfig3_install/install/autoinstall.ini
20+
21+
service mysql start && php -q $CI_PROJECT_DIR/install/install.php --autoinstall=/root/ispconfig3_install/install/autoinstall.ini

0 commit comments

Comments
 (0)