-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
packages: | ||
yum: | ||
wget: [] | ||
openssl-libs: [] | ||
compat-openssl10: [] | ||
docker: [] | ||
|
||
commands: | ||
01_add_mysql_repo: | ||
command: | | ||
sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm -O /tmp/mysql80-community-release-el7-3.noarch.rpm && \ | ||
sudo rpm -Uvh /tmp/mysql80-community-release-el7-3.noarch.rpm && \ | ||
sudo yum clean all | ||
ignoreErrors: false | ||
test: test ! -f /etc/yum.repos.d/mysql-community.repo | ||
|
||
02_install_mysql: | ||
command: "sudo yum -y install mysql-community-server" | ||
ignoreErrors: false | ||
|
||
03_start_mysql: | ||
command: "sudo service mysqld start" | ||
01_start_docker_service: | ||
command: "sudo service docker start" | ||
ignoreErrors: false | ||
|
||
04_create_database: | ||
command: "mysql -u root -e 'CREATE DATABASE IF NOT EXISTS ddingdong_test'" | ||
02_pull_mysql_image: | ||
command: "sudo docker pull mysql:8.0" | ||
ignoreErrors: false | ||
|
||
05_create_user: | ||
03_run_mysql_container: | ||
command: | | ||
mysql -u root -e "CREATE USER IF NOT EXISTS 'myuser'@'localhost' IDENTIFIED BY 'mypassword';" && \ | ||
mysql -u root -e "GRANT ALL PRIVILEGES ON ddingdong_test.* TO 'myuser'@'localhost';" && \ | ||
mysql -u root -e "FLUSH PRIVILEGES;" | ||
sudo docker run -d \ | ||
--name=mysql80 \ | ||
-e MYSQL_ROOT_PASSWORD=ddingdong \ | ||
-e MYSQL_DATABASE=ddingdong_test \ | ||
-e MYSQL_USER=myuser \ | ||
-e MYSQL_PASSWORD=ddingdong \ | ||
-p 3306:3306 \ | ||
mysql:8.0 | ||
ignoreErrors: false |