You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-panel-v3-mod_Uim2/.travis.yml

99 lines
4.0 KiB
YAML

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
8 years ago
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 test@example.com 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