daddy 0.12.7 → 0.12.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0413874c6f66e786947ca1336e8f7a2e7617079cfd46a27127379ec2432e4582'
4
- data.tar.gz: fc971c0de0ffe1608e7cf575e964a050393294a5352169901204313ea89f30ee
3
+ metadata.gz: 162ab2d7f49f90f851d2c3823e9f1a4246817fa3ea89f64b53cd3db32335796d
4
+ data.tar.gz: c5bafb7a41b05b285e115b946d4ab5d57b3078d35a052c34b7a566e9fa22b6c5
5
5
  SHA512:
6
- metadata.gz: e4953dfe28b2f5b5b4aed0f0f7fd770ed5bb83b45277f67f718f8d728a315b744d032ad286aedd140f23b6e494732d526257bb5b27a0860eab7ea99c7dd16815
7
- data.tar.gz: f0bf2781472da92ec9448447657d83272b9052e5fb56c5118d28c989b4c2bc78f2345f5b7b6474ae0cdce14837428ceda5788733602f15762135c4efa8f97dd4
6
+ metadata.gz: 22405be8da4bab2d08bcefc89def041801269c4e84e09620fcc46c0d5da8b53b886b65570cc87be390ab4acf699c65d06339032af4b2eda00e777e87ab72523c
7
+ data.tar.gz: 49b939e77cf6d919ac873e90c64956370f69461d0db8cbc0846b31e66ae976cb4b31c3114c3c58568614d7ca99b87b74843f67f1972d9740eb49cc3c1c975adf
@@ -0,0 +1,9 @@
1
+ [nodesource-nodejs]
2
+ name=Node.js Packages for Linux RPM based distros - x86_64
3
+ baseurl=https://rpm.nodesource.com/pub_26.x/nodistro/nodejs/x86_64
4
+ priority=9
5
+ enabled=0
6
+ gpgcheck=1
7
+ gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key
8
+ module_hotfixes=1
9
+
@@ -2,15 +2,15 @@ execute 'place /etc/yum.repos.d/nodesource-nodejs.repo' do
2
2
  user 'root'
3
3
  command <<-EOF
4
4
  set -eu
5
- sudo cp -f #{::File.join(::File.dirname(__FILE__), 'files/etc/yum.repos.d/nodesource-nodejs-v24.repo')} /etc/yum.repos.d/nodesource-nodejs.repo
5
+ sudo cp -f #{::File.join(::File.dirname(__FILE__), 'files/etc/yum.repos.d/nodesource-nodejs-v26.repo')} /etc/yum.repos.d/nodesource-nodejs.repo
6
6
  sudo chmod 644 /etc/yum.repos.d/nodesource-nodejs.repo
7
7
  EOF
8
- not_if "diff #{::File.join(::File.dirname(__FILE__), 'files/etc/yum.repos.d/nodesource-nodejs-v24.repo')} /etc/yum.repos.d/nodesource-nodejs.repo"
8
+ not_if "diff #{::File.join(::File.dirname(__FILE__), 'files/etc/yum.repos.d/nodesource-nodejs-v26.repo')} /etc/yum.repos.d/nodesource-nodejs.repo"
9
9
  end
10
10
 
11
11
  package 'nodejs' do
12
12
  user 'root'
13
- version '24.20.0-1nodesource'
13
+ version '26.13.1-1nodesource'
14
14
  options '--enablerepo=nodesource-nodejs'
15
15
  end
16
16
 
@@ -1,4 +1,4 @@
1
- version = ENV['RUBY_VERSION'] || '3.4.10'
1
+ version = ENV['RUBY_VERSION'] || '3.4.13'
2
2
  short_version = version.split('.')[0..1].join('.')
3
3
 
4
4
  execute "download ruby-#{version}" do
@@ -0,0 +1 @@
1
+ 7bb4d4f5e807cc27251d14d9d6086d182c5b25875191e44ab15b709cd7a7dd9c ruby-3.4.12.tar.gz
@@ -0,0 +1 @@
1
+ d0d3bf3dd8c224a3c3b7ecd816a0f1b2cbcf4f87b5afcbdbe91d3fef177f351a ruby-3.4.13.tar.gz
@@ -8,7 +8,9 @@ module Daddy
8
8
  daddy_yml = File.join('config', 'daddy.yml')
9
9
  if File.exist?(daddy_yml)
10
10
  parsed = ERB.new(File.read(daddy_yml), trim_mode: '-').result
11
- @_config = Daddy::Utils::Config.new(YAML.load(parsed))
11
+ @_config = Daddy::Utils::Config.new(
12
+ YAML.safe_load(parsed, aliases: true)
13
+ )
12
14
  else
13
15
  @_config = Daddy::Utils::Config.new
14
16
  end
data/lib/daddy/version.rb CHANGED
@@ -2,6 +2,6 @@ module Daddy
2
2
  VERSION = [
3
3
  VERSION_MAJOR = '0',
4
4
  VERSION_MINOR = '12',
5
- VERSION_REVISION = '7'
5
+ VERSION_REVISION = '8'
6
6
  ].join('.')
7
7
  end
@@ -2,99 +2,9 @@ require_relative 'task_helper'
2
2
 
3
3
  namespace :dad do
4
4
  namespace :db do
5
- include DatabaseHelpers
6
-
7
5
  desc 'database.yml に従ってDBを作成します。'
8
6
  task :create do
9
- config = YAML.safe_load(ERB.new(File.read('config/database.yml'), trim_mode: '-').result, aliases: true)
10
-
11
- FileUtils.mkdir_p("tmp")
12
- system("echo '# mysql ddl' > tmp/create_databases.sql")
13
-
14
- # Collect all unique users from the target environment and databases
15
- users = {}
16
- host = port = nil
17
-
18
- config.each do |env, props|
19
- next if env == 'default'
20
- next if ENV['RAILS_ENV'] and ENV['RAILS_ENV'] != env
21
-
22
- if multiple_databases?(props)
23
- # Multiple databases configuration (Rails 8 style)
24
- props.each do |db_name, db_config|
25
- next unless db_config.is_a?(Hash) && db_config['username']
26
- username = db_config['username']
27
- users[username] ||= {
28
- 'password' => db_config['password'],
29
- 'host' => db_config['host'],
30
- 'port' => db_config['port']
31
- }
32
- host ||= db_config['host']
33
- port ||= db_config['port']
34
- end
35
- else
36
- # Single database configuration
37
- next unless props['username']
38
- username = props['username']
39
- users[username] ||= {
40
- 'password' => props['password'],
41
- 'host' => props['host'],
42
- 'port' => props['port']
43
- }
44
- host ||= props['host']
45
- port ||= props['port']
46
- end
47
- end
48
-
49
- # Create users
50
- users.each do |username, user_info|
51
- system("echo 'drop user if exists \"#{username}\"@\"%\";' >> tmp/create_databases.sql")
52
- system("echo 'create user \"#{username}\"@\"%\" IDENTIFIED BY \"#{user_info['password']}\";' >> tmp/create_databases.sql")
53
- end
54
-
55
- # Create databases
56
- config.each do |env, props|
57
- next if env == 'default'
58
- next if ENV['RAILS_ENV'] and ENV['RAILS_ENV'] != env
59
-
60
- if multiple_databases?(props)
61
- # Multiple databases configuration (Rails 8 style)
62
- props.each do |db_name, db_config|
63
- next unless db_config.is_a?(Hash) && db_config['database']
64
- database = db_config['database']
65
- username = db_config['username']
66
-
67
- create_database_sql(database, username, env)
68
- puts "database #{database} (#{env}/#{db_name}) written to tmp/create_databases.sql"
69
- end
70
- else
71
- # Single database configuration
72
- next unless props['database']
73
- database = props['database']
74
- username = props['username']
75
-
76
- create_database_sql(database, username, env)
77
- puts "database #{database} (#{env}) written to tmp/create_databases.sql"
78
- end
79
- end
80
-
81
- system("echo 'flush privileges;' >> tmp/create_databases.sql")
82
- system("echo >> tmp/create_databases.sql")
83
-
84
- options = []
85
- if host
86
- port ||= 3306 if host != 'localhost'
87
- options << "-h #{host}"
88
- options << "-P #{port}" if port
89
- end
90
- options << "-u #{ENV['MYSQL_ROOT'] || 'root'}"
91
- unless ENV['MYSQL_ALLOW_EMPTY_PASSWORD']
92
- options << '-p'
93
- end
94
-
95
- command = "mysql #{options.join(' ')} < tmp/create_databases.sql"
96
- puts command
97
- fail unless system(command)
7
+ run_rustic 'db', 'create'
98
8
  end
99
9
  end
100
- end
10
+ end
@@ -2,24 +2,10 @@ require_relative 'task_helper'
2
2
 
3
3
  namespace :dad do
4
4
  namespace :db do
5
-
6
- desc "データベースをダンプします。"
5
+ desc 'データベースをダンプします。'
7
6
  task :dump do
8
- dump_dir = ENV['DUMP_DIR'] || ask('出力先ディレクトリ', :required => true)
9
-
10
- config = YAML.load(ERB.new(File.read('config/database.yml'), trim_mode: '-').result)[Rails.env]
11
-
12
- host = config['host'] || 'localhost'
13
- database = config['database']
14
- user = config['username']
15
- password = config['password']
16
-
17
- filepath = File.join(dump_dir, "#{database}-#{Time.now.strftime('%Y-%m-%d_%H%M')}.dump.gz")
18
-
19
- run "mkdir -p #{File.dirname(filepath)}",
20
- "mysqldump -u #{user} -p#{password} -h #{host} #{database} --no-tablespaces | gzip > #{filepath}",
21
- :mask => [/-p[^ ]+/, '-pFILTERED']
7
+ ENV['DUMP_DIR'] ||= ask('出力先ディレクトリ', :required => true)
8
+ run_rustic 'db', 'dump'
22
9
  end
23
10
  end
24
-
25
- end
11
+ end
@@ -2,26 +2,10 @@ require_relative 'task_helper'
2
2
 
3
3
  namespace :dad do
4
4
  namespace :db do
5
-
6
- desc "データベースをロードします。"
5
+ desc 'データベースをロードします。'
7
6
  task :load do
8
- dump_file = ENV['DUMP_FILE'] || ask('ダンプファイル', :required => true)
9
-
10
- config = YAML.load(ERB.new(File.read('config/database.yml'), trim_mode: '-').result)[Rails.env]
11
-
12
- host = config['host'] || 'localhost'
13
- database = config['database']
14
- user = config['username']
15
- password = config['password']
16
-
17
- if dump_file.end_with?('.gz')
18
- run "zcat #{dump_file} | mysql -u #{user} -p#{password} -h #{host} #{database}",
19
- :mask => [/-p[^ ]+/, '-pFILTERED']
20
- else
21
- run "mysql -u #{user} -p#{password} -h #{host} #{database} < #{dump_file}",
22
- :mask => [/-p[^ ]+/, '-pFILTERED']
23
- end
7
+ ENV['DUMP_FILE'] ||= ask('ダンプファイル', :required => true)
8
+ run_rustic 'db', 'load'
24
9
  end
25
-
26
10
  end
27
- end
11
+ end
@@ -141,39 +141,6 @@ def self.run_itamae(*recipes)
141
141
  run "bundle exec itamae local #{options.join(' ')} #{recipe_files.join(' ')}"
142
142
  end
143
143
 
144
- # Database helper methods for dad:db namespace
145
- module DatabaseHelpers
146
- # Helper method to check if a configuration is multiple databases (Rails 8 style)
147
- def multiple_databases?(props)
148
- return false unless props.is_a?(Hash)
149
- # Standard Rails database config keys
150
- standard_keys = ['adapter', 'collation', 'database', 'encoding', 'host', 'max_connections', 'migrations_paths', 'password', 'port', 'url', 'username']
151
- # If it has a 'database' key directly, it's a single database config
152
- return false if props.key?('database')
153
- # If it has keys that are not standard keys and those values are hashes with 'database' keys, it's multiple databases
154
- props.any? do |key, value|
155
- !standard_keys.include?(key.to_s) && value.is_a?(Hash) && value.key?('database')
156
- end
157
- end
158
-
159
- # Helper method to write database creation SQL commands
160
- def create_database_sql(database, username, env = nil)
161
- system("echo 'drop database if exists #{database};' >> tmp/create_databases.sql")
162
- system("echo 'create database #{database};' >> tmp/create_databases.sql")
163
-
164
- # test環境はRailsの並列テストが database-0, database-1 ... を追加で作るため、
165
- # それらにも権限が及ぶようワイルドカードでGRANTする(既存の"_"はリテラル一致させるためエスケープする)
166
- # バッククォートで囲むと、mysqlクライアントが行中の"\_"をコマンドと誤解釈するのを防ぎつつ、
167
- # GRANTのdb_nameパターンとしては(通常のバッククォート識別子と異なり)バックスラッシュエスケープと
168
- # ワイルドカードが有効なまま解釈される
169
- escaped_database = database.gsub('_', '\\_')
170
- grant_target = env == 'test' ? "`#{escaped_database}%`" : database
171
-
172
- system("echo 'grant all on #{grant_target}.* to \"#{username}\"@\"%\";' >> tmp/create_databases.sql")
173
-
174
- if ENV['FILE']
175
- system("echo 'grant all on #{grant_target}.* to \"#{username}\"@localhost;' >> tmp/create_databases.sql")
176
- system("echo 'grant file on *.* to \"#{username}\"@localhost;' >> tmp/create_databases.sql")
177
- end
178
- end
144
+ def self.run_rustic(*args)
145
+ run(["bundle", "exec", "rustic", *args].shelljoin)
179
146
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.7
4
+ version: 0.12.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
@@ -107,6 +107,20 @@ dependencies:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rustic-rails
112
+ requirement: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ type: :runtime
118
+ prerelease: false
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
110
124
  - !ruby/object:Gem::Dependency
111
125
  name: ci_reporter
112
126
  requirement: !ruby/object:Gem::Requirement
@@ -290,6 +304,7 @@ files:
290
304
  - itamae/environments/nodejs/files/etc/yum.repos.d/nodesource-nodejs-v20.repo
291
305
  - itamae/environments/nodejs/files/etc/yum.repos.d/nodesource-nodejs-v22.repo
292
306
  - itamae/environments/nodejs/files/etc/yum.repos.d/nodesource-nodejs-v24.repo
307
+ - itamae/environments/nodejs/files/etc/yum.repos.d/nodesource-nodejs-v26.repo
293
308
  - itamae/environments/nodejs/files/etc/yum.repos.d/yarn.repo
294
309
  - itamae/environments/nodejs/nodejs.rb
295
310
  - itamae/environments/nodejs/yarn.rb
@@ -297,6 +312,8 @@ files:
297
312
  - itamae/environments/ruby/ruby-2.7.8.tar.gz_sha256sum.txt
298
313
  - itamae/environments/ruby/ruby-3.2.9.tar.gz_sha256sum.txt
299
314
  - itamae/environments/ruby/ruby-3.4.10.tar.gz_sha256sum.txt
315
+ - itamae/environments/ruby/ruby-3.4.12.tar.gz_sha256sum.txt
316
+ - itamae/environments/ruby/ruby-3.4.13.tar.gz_sha256sum.txt
300
317
  - itamae/environments/ruby/ruby-3.4.8.tar.gz_sha256sum.txt
301
318
  - itamae/environments/ruby/ruby-3.4.9.tar.gz_sha256sum.txt
302
319
  - itamae/locale/en.yml