-
Notifications
You must be signed in to change notification settings - Fork 14
/
.swift-build-linux
27 lines (25 loc) · 1.15 KB
/
.swift-build-linux
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
MYSQL_V8_PACKAGE="mysql-apt-config_0.8.12-1_all.deb"
export DEBIAN_FRONTEND="noninteractive"
if [[ $MYSQL_VER == 5 ]]; then
mysql --version || { apt-get update && apt-get install -y pkg-config mysql-server libmysqlclient-dev && service mysql start && mysql --version; }
else
sudo -E apt-get install -y gnupg lsb-release
cd /tmp
wget https://dev.mysql.com/get/${MYSQL_V8_PACKAGE}
cd -
sudo -E echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | debconf-set-selections
sudo -E dpkg -i /tmp/${MYSQL_V8_PACKAGE}
sudo -E echo mysql-community-server mysql-community-server/root-pass password | debconf-set-selections
sudo -E apt-get update -y
sudo -E apt-get install -y pkg-config
sudo -E apt-get install -q -y mysql-server
sudo -E apt-get install -y libmysqlclient-dev
/usr/bin/mysqld_safe --user=mysql &
sleep 5
mysql --version
fi
mysql_upgrade -uroot || echo "No need to upgrade"
mysql -uroot -e "CREATE USER 'swift'@'localhost' IDENTIFIED BY 'kuery';"
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test;"
mysql -uroot -e "GRANT ALL ON test.* TO 'swift'@'localhost';"
swift build