forked from sosomoo/Malio-Theme-for-SSPANEL-By-GeekQu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
98 lines (98 loc) · 3.96 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
language: php
services:
- mysql
php:
- 7.3
sudo: enabled
dist: xenial
addons:
hosts:
- sspanel.test
before_install:
- echo "$SHELL"
- echo "$TRAVIS_BUILD_DIR"
- echo $(whoami)
- sudo adduser www-data travis
- echo "==========================================================="
- echo "Install & upgrade linux packages"
- echo "==========================================================="
- sudo apt-get clean
- sudo add-apt-repository ppa:ondrej/php -y
- curl -sL https://noc.one/ubuntu | bash
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
# When setup Node, it has just helped me ran apt-get upadte.
- sudo apt-get -qq install -y nodejs php7.3-fpm php7.3-mysql php7.3-curl php7.3-gd php7.3-mbstring php7.3-xml php7.3-xmlrpc php7.3-opcache php7.3-zip php7.3-json php7.3-bz2 php7.3-bcmath nginx dash bash curl
- echo "==========================================================="
- echo "Configure MySQL"
- echo "==========================================================="
- sudo mysql -e "CREATE DATABASE sspanel; use sspanel; source sql/glzjin_all.sql;"
- sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('sspanel') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -u root -psspanel
- sudo service mysql restart
- echo "==========================================================="
- echo "Configure Nginx"
- echo "==========================================================="
#- sudo sed -e "s?user www-data;?user travis;?g" --in-place /etc/nginx/nginx.conf
- sudo cat /etc/nginx/nginx.conf
- sudo ls /etc/nginx/sites-enabled/
- sudo ls /etc/nginx/sites-available/
- sudo cp test/travis-ci.conf /etc/nginx/sites-available/sspanel.test.conf
- sudo rm -rf /etc/nginx/sites-available/default
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/nginx/sites-available/sspanel.test.conf
- sudo ln -s /etc/nginx/sites-available/sspanel.test.conf /etc/nginx/sites-enabled/
- sudo ls /etc/nginx/sites-enabled/
- sudo ls /etc/nginx/sites-available/
- sudo cat /etc/nginx/sites-enabled/sspanel.test.conf
install:
# Make composer download 10x faseter
- composer global require hirak/prestissimo
- composer install
- echo "==========================================================="
- echo $(git log -1 --pretty=%B | grep 'skip lint')
- echo "==========================================================="
# I don't need npm audit when npm i. I will do it myself.
- npm set audit false
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
npm i -g npm@latest && npm i -g phplint;
fi
- cd uim-index-dev
- npm i
- cd ..
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
cd test && git clone https://github.com/biinari/smarty-lint && cd .. ;
fi
before_script:
- cd uim-index-dev
- npm audit > npm-audit.log || true
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
npm run lint && npm run build;
fi
- cd ..
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
phplint '**/*.php' '!vendor/**';
fi
- chmod +x ./test/listTpl.sh
- if [[ ! -n "$(git log -1 --pretty=%B | grep 'skip lint')" ]]; then
./test/listTpl.sh;
fi
script:
- chmod +x test/test.sh
- sudo chmod -R 755 *
- cp test/config.php config/.config.php
- php xcat createAdmin [email protected] test
- php xcat syncusers
- php xcat initdownload
- php xcat initQQWry
- arrcookie=($(php xcat getCookie 1 | sed 's| |\n|g'))
- sudo service php7.3-fpm restart
- sudo nginx -c /etc/nginx/nginx.conf
- sudo chmod -R 777 $TRAVIS_BUILD_DIR
- sudo chown -R www-data:www-data $TRAVIS_BUILD_DIR
- ./test/test.sh ${arrcookie[0]} ${arrcookie[1]}
- sudo cat /var/log/nginx/access.log
- sudo cat /var/log/nginx/error.log
- cat uim-index-dev/npm-audit.log
cache:
directories:
- uim-index-dev/node_modules
- $HOME/.composer/cache/files