Skip to content

Commit

Permalink
Configure DBs on Azure tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzmbrzl committed Jun 23, 2024
1 parent 380053a commit 5c928be
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .ci/azure-pipelines/install-environment_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,27 @@ sudo apt-get -y install build-essential g++-multilib ninja-build pkg-config \
libogg-dev libsndfile1-dev libopus-dev libspeechd-dev \
libavahi-compat-libdnssd-dev libzeroc-ice-dev \
zsync appstream libpoco-dev



# Setup MySQL and PostgreSQL databases for the Mumble tests
echo "Configuring MySQL..."

echo -e "[mysqld]\nlog-bin-trust-function-creators = 1" | sudo tee -a /etc/mysql/my.cnf

sudo systemctl enable mysql.service
sudo systemctl start mysql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER 'mumble_test_user'@'localhost' IDENTIFIED BY 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON mumble_test_db.* TO 'mumble_test_user'@'localhost';" | sudo mysql --user=root --password="root"


echo "Configuring PostgreSQL..."

sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;" | sudo -u postgres psql
23 changes: 22 additions & 1 deletion .ci/azure-pipelines/install-environment_macos.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,25 @@ mkdir -p $MUMBLE_ENVIRONMENT_STORE

chmod +x "$MUMBLE_ENVIRONMENT_PATH/installed/$MUMBLE_ENVIRONMENT_TRIPLET/tools/Ice/slice2cpp"

ls -l $MUMBLE_ENVIRONMENT_STORE

# Setup MySQL and PostgreSQL databases for the Mumble tests
echo "Configuring MySQL..."
brew install mysql

mysql --help

echo -e "[mysqld]\nlog-bin-trust-function-creators = 1" | sudo tee -a /etc/mysql/my.cnf

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER 'mumble_test_user'@'localhost' IDENTIFIED BY 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON mumble_test_db.* TO 'mumble_test_user'@'localhost';" | sudo mysql --user=root


echo "Configuring PostgreSQL..."

sudo systemctl enable postgresql.service
sudo systemctl start postgresql.service

echo "CREATE DATABASE mumble_test_db; "\
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;" | sudo -u postgres psql
14 changes: 14 additions & 0 deletions .ci/install-environment_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,17 @@ Invoke-Command 7z x "WixSharp.7z" "-oC:/WixSharp"
choco install vswhere

Write-Host "Build environment successfully installed"


# Setup MySQL and PostgreSQL databases for the Mumble tests
Write-Host "Configuring MySQL..."
mysql --help
Write-Host "[mysqld]`nlog-bin-trust-function-creators = 1" #| sudo tee -a /etc/mysql/my.cnf


Write-Host "Configuring PostgreSQL..."
Start-Service -Name "postgresql-x64-14"

Write-Output "CREATE DATABASE mumble_test_db; "\
"CREATE USER mumble_test_user ENCRYPTED PASSWORD 'MumbleTestPassword'; "\
"GRANT ALL PRIVILEGES ON DATABASE mumble_test_db TO mumble_test_user;" | psql --user "potsgres" --password "root"

0 comments on commit 5c928be

Please sign in to comment.