-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
54 lines (45 loc) · 1.95 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
language: php
php: '7.2'
fast_fail: true
env:
global:
- MYSQL_PASSWORD=travis
- XENFORO_ADDON_ID=SModders/TelegramCore
services:
- mysql
before_install:
# Update apt cache
- sudo apt-get update
# Install MySQL, create database and set password for "root".
- sudo -E apt-get -q -y install unzip
- mysql -e 'CREATE DATABASE xenforo'
- mysqladmin -u root password ${MYSQL_PASSWORD}
# Download and unzip XenForo
- mkdir -p ${TRAVIS_BUILD_DIR}/xenforo
- cd ${TRAVIS_BUILD_DIR}/xenforo
- wget -q ${XENFORO_BASEURL}/${XENFORO_FILENAME}
- unzip -q ${XENFORO_FILENAME}
- cd upload
before_script:
# Go to XF/src
- cd ${TRAVIS_BUILD_DIR}/xenforo/upload/src
# Fill config
- echo "<?php" > config.php
- echo "\$config['db']['host'] = 'localhost';" >> config.php
- echo "\$config['db']['port'] = 3306;" >> config.php
- echo "\$config['db']['username'] = 'root';" >> config.php
- echo "\$config['db']['password'] = '${MYSQL_PASSWORD}';" >> config.php
- echo "\$config['db']['dbname'] = 'xenforo';" >> config.php
- echo "\$config['debug'] = true;" >> config.php
- echo "\$config['development']['enabled'] = true;" >> config.php
- cd ..
- export XENFORO_INSTALLATION=$(pwd)
# Install.
- php cmd.php xf:install -q --user=Travis --password=Travis --email noreply@travis-ci.com --title=Travis --url=http://localhost --skip-statistics --clear
script:
# Copy files for our addon, import all, grab composer packages and build release.
- cp -Rf ${TRAVIS_BUILD_DIR}/* ${XENFORO_INSTALLATION}/src/addons/${XENFORO_ADDON_ID}
- cd ${XENFORO_INSTALLATION}/src/addons/${XENFORO_ADDON_ID}
- composer install
- cd ${XENFORO_INSTALLATION}
- php cmd.php xf-addon:install -n ${XENFORO_ADDON_ID} && php cmd.php xf-dev:import -n -a ${XENFORO_ADDON_ID} && php cmd.php xf-addon:build-release ${XENFORO_ADDON_ID}