diff --git a/builders/pantheon-mariadb-arm.js b/builders/pantheon-mariadb-arm.js index ce73b20..6c7f04c 100644 --- a/builders/pantheon-mariadb-arm.js +++ b/builders/pantheon-mariadb-arm.js @@ -24,7 +24,6 @@ module.exports = { password: 'pantheon', user: 'pantheon', }, - healthcheck: 'mysql -uroot --silent --execute "SHOW DATABASES;"', port: '3306', defaultFiles: { database: 'my_custom.cnf', @@ -41,6 +40,8 @@ module.exports = { // Change the me user options.meUser = 'mysql'; + if (!options.healthcheck) options.healthcheck = require('../utils/get-mariadb-healthcheck')(options); + const mariadb = { image: `mariadb:${options.version}`, command: 'docker-entrypoint.sh mysqld', diff --git a/utils/get-mariadb-healthcheck.js b/utils/get-mariadb-healthcheck.js new file mode 100644 index 0000000..cf67b74 --- /dev/null +++ b/utils/get-mariadb-healthcheck.js @@ -0,0 +1,15 @@ +'use strict'; + +// checks to see if a setting is disabled +module.exports = options => { + return [ + 'mysql', + `--host=${options.name}`, + `--user=${options.creds.user}`, + `--database=${options.creds.database}`, + `--password=${options.creds.password}`, + '--silent', + '--execute', + '"SHOW TABLES;"', + ].join(' '); +};