Skip to content

Commit

Permalink
Remove apt statements, and replace mysql with mariadb commands
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-riggs committed Aug 20, 2024
1 parent 10b4461 commit 2c7ffd2
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,23 @@ jobs:
cp "./conf/ws_config.example.cfg" "./conf/ws_config.cfg"
tar xfz "dist/ispyb-database.tar.gz"

apt-get update && apt-get install sudo -y
sudo service mariadb start

printf 'Waiting for MySQL database to accept connections'
until mysql -e "SHOW DATABASES" >/dev/null; do printf '.'; sleep 0.5; done
until mariadb -e "SHOW DATABASES" >/dev/null; do printf '.'; sleep 0.5; done
printf '\n'

mysql -e "SET GLOBAL log_bin_trust_function_creators = 1;"
mariadb -e "SET GLOBAL log_bin_trust_function_creators = 1;"
for f in schemas/ispyb/tables.sql \
schemas/ispyb/lookups.sql \
schemas/ispyb/data.sql \
schemas/ispyb/routines.sql \
grants/ispyb_processing.sql \
grants/ispyb_import.sql; do
echo Importing ${f}...
mysql < $f
mariadb < $f
done
mysql -e "CREATE USER ispyb_api@'%' IDENTIFIED BY 'password_1234'; GRANT ispyb_processing to ispyb_api@'%'; GRANT ispyb_import to ispyb_api@'%'; SET DEFAULT ROLE ispyb_processing FOR ispyb_api@'%';"
mysql -e "CREATE USER ispyb_api_future@'%' IDENTIFIED BY 'password_4321'; GRANT SELECT ON ispybtest.* to ispyb_api_future@'%';"
mysql -e "CREATE USER ispyb_api_sqlalchemy@'%' IDENTIFIED BY 'password_5678'; GRANT SELECT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT INSERT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT UPDATE ON ispybtest.* to ispyb_api_sqlalchemy@'%';"
mariadb -e "CREATE USER ispyb_api@'%' IDENTIFIED BY 'password_1234'; GRANT ispyb_processing to ispyb_api@'%'; GRANT ispyb_import to ispyb_api@'%'; SET DEFAULT ROLE ispyb_processing FOR ispyb_api@'%';"
mariadb -e "CREATE USER ispyb_api_future@'%' IDENTIFIED BY 'password_4321'; GRANT SELECT ON ispybtest.* to ispyb_api_future@'%';"
mariadb -e "CREATE USER ispyb_api_sqlalchemy@'%' IDENTIFIED BY 'password_5678'; GRANT SELECT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT INSERT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT UPDATE ON ispybtest.* to ispyb_api_sqlalchemy@'%';"
rm ~/.my.cnf

- name: Run tests
Expand Down

0 comments on commit 2c7ffd2

Please sign in to comment.