-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
50 lines (38 loc) · 1.49 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
## SETUP file for Travis
## Make sure to rename the database name in the CREATE DATABASE script below to the SAME name as used for your local tests
---
dist: bionic
language: java
cache:
directories:
- $HOME/.m2
script:
- mvn test
- mvn -Dremote.user=$REMOTE_USER -Dremote.password=$REMOTE_PW tomcat7:undeploy tomcat7:deploy
services:
- mysql
before_script:
# TODO Add variable to make it simple to be reusable for all semester projects
#- export DEBIAN_FRONTEND="noninteractive";
#- PW="ax2"
#- USER_NAME="dev"
#- sudo apt-get clean
#- sudo rm -r /var/lib/apt/lists/*
- sudo apt-get update || true
- sudo apt-get install -y debconf-utils
- sudo debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-server select mysql-8.0'
- wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
- sudo -E dpkg -i mysql-apt-config_0.8.13-1_all.deb
- sudo apt-get update || true
- echo "Installing MySQL 8..."
- sudo -E apt-get -y install mysql-server
- sudo mysql -u root -e "CREATE User 'dev'@'localhost' IDENTIFIED BY 'ax2'; GRANT ALL PRIVILEGES ON *.* TO 'dev'@'localhost' WITH GRANT OPTION;"
# - sudo mysql -u root -e "CREATE DATABASE startcodev2-test;"
- sudo mysql -u dev -pax2 -e "CREATE DATABASE CA1_test;"
- echo "Change port to 3307, to mirror the local development setup"
- sudo systemctl stop mysql
- sudo sh -c 'echo "port=3307" >> /etc/mysql/mysql.conf.d/mysqld.cnf'
- echo "Restarting MySQL..."
- sudo systemctl start mysql
- mysql --version
- echo "before_script Complete"