mysql_in_docker 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a200afe8fada88ec37ac643a3da2348e01874c3e12cf0282c7a36afba2b9ddbb
4
- data.tar.gz: ad522ee1ff382b246a4ec58d18ea911d0d33438eec8ab3609769080e96c3102d
3
+ metadata.gz: 6a20304825a647b19b445ef478c2e0669c601fae18abd804c412481bf1ac5b1b
4
+ data.tar.gz: 0dfc6453132f63ec36c7c5658ed2e3f68bee2debc7a2185453459078fce41004
5
5
  SHA512:
6
- metadata.gz: f12bfd6a2b0a5adbe862101b18698d2bf27399d17aca87ca7c56feb7fbe891211a47ba826e7684b4c7a1efe973fcb1421a012b57252593b5703f36b43c0ab472
7
- data.tar.gz: 18fb8a92f1e97f84adef7fb0180a4421cd4d08ee62598816701e221975ef2bea14c81a5aef104f9a69bb40db706590d82cea44f6076c821f8b494081cec80357
6
+ metadata.gz: 22789a1b94b68a5e6c6368e3a9733514ebafa2e209ede922d7aba185b823fdd681f5a8197c21b9cd4b2ccc3cc94ea61e2f8ec69e884391860ffb47d79d741828
7
+ data.tar.gz: 728b10cbe380287fc28263eceb3de6fdf303a5488350dfa077742496052065b61960852aad4e38d0f52a73143842858490b857470d8ca5e21447dfd7fbfb287f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mysql_in_docker (0.0.3)
4
+ mysql_in_docker (0.0.4)
5
5
  thor
6
6
 
7
7
  GEM
data/lib/commands.rb CHANGED
@@ -61,21 +61,29 @@ module MysqlInDocker
61
61
  "mysql_in_docker_#{id}"
62
62
  end
63
63
 
64
+ def arm?
65
+ RUBY_PLATFORM.start_with? "arm"
66
+ end
67
+
64
68
  def get_image_name(version)
65
- is_arm = RUBY_PLATFORM.start_with? "arm"
66
- image = is_arm ? "mysql/mysql-server" : "mysql"
69
+ image = arm? ? "mysql/mysql-server" : "mysql"
67
70
 
68
- return "#{image}:8.0" if is_arm && version == "8"
71
+ return "#{image}:8.0" if arm? && version == "8"
69
72
 
70
73
  "#{image}:#{version}"
71
74
  end
72
75
 
76
+ def get_envs(mysql_root_password)
77
+ arr = ["--env", "MYSQL_ROOT_PASSWORD=#{mysql_root_password}"]
78
+ arr.concat ["--env", "MYSQL_ROOT_HOST=%"] if arm?
79
+ arr
80
+ end
81
+
73
82
  def up_command(id, version, port, mysql_root_password) # rubocop:disable Metrics/MethodLength
74
83
  [
75
84
  "run",
76
85
  "--name", get_container_name(id),
77
- "--env",
78
- "MYSQL_ROOT_PASSWORD=#{mysql_root_password}",
86
+ *get_envs(mysql_root_password),
79
87
  "--publish",
80
88
  "#{port}:3306",
81
89
  "--volume",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MysqlInDocker
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql_in_docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sijia Wang