1c66ee26 |
1 | #!/bin/bash -xe |
2 | |
c05721c7 |
3 | DRUPAL_DB_PASSWORD="H0z7WC8Xq8yRE" |
1c66ee26 |
4 | |
5 | # install the mysql server |
6 | apt install -y mariadb-server ||: |
7 | # installation "fails" when working in a chroot |
8 | # so we just ignore it |
9 | # should work on a regular system, but this part can't be tested in a chroot |
10 | |
11 | # set up mysql with defaults |
12 | mysql_secure_installation < /sqldefaults |
13 | |
14 | # add the drupal db |
c05721c7 |
15 | mysql -u root -p -e 'CREATE DATABASE dbd_drupal CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;' |
16 | mysql -u root -p -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON dbd_drupal.* TO 'w_dbd'@'localhost' IDENTIFIED BY '$DRUPAL_DB_PASSWORD';" |
1c66ee26 |
17 | |
c05721c7 |
18 | ## and have drupal do the site-install |
19 | #cd /var/www/html |
20 | #vendor/bin/drush site-install --db-url=mysql://drupaluser:$DRUPAL_DB_PASSWORD@localhost/drupal |
1c66ee26 |
21 | |
22 | # make sure perms are right |
23 | chown -R www-data:www-data /var/www/html |