1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/.devcontainer/boot.sh
Rafael Mendonça França eb04c7f61c Start the mariadb service in the dev container
Signed-off-by: GitHub <noreply@github.com>
2021-09-21 21:04:43 +00:00

22 lines
892 B
Bash
Executable file

bundle install
yarn install
sudo service postgresql start
sudo service mariadb start
sudo service redis-server start
sudo service memcached start
# Create PostgreSQL users and databases
sudo su postgres -c "createuser --superuser vscode"
sudo su postgres -c "createdb -O vscode -E UTF8 -T template0 activerecord_unittest"
sudo su postgres -c "createdb -O vscode -E UTF8 -T template0 activerecord_unittest2"
# Create MySQL database and databases
MYSQL_PWD=root sudo mysql -uroot <<SQL
CREATE USER 'rails'@'localhost';
CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;
CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON activerecord_unittest.* to 'rails'@'localhost';
GRANT ALL PRIVILEGES ON activerecord_unittest2.* to 'rails'@'localhost';
GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';
SQL