Skip to content

Commit

Permalink
feat: 🎸 dist CSV を export するタスクを更新して全てのファイルに対応した (#72)
Browse files Browse the repository at this point in the history
* feat: 🎸 dist CSV を export するタスクを更新して全てのファイルに対応した

* ci: 🎡 タスクの変更に伴い CI も変更した
  • Loading branch information
nikukyugamer committed Dec 7, 2023
1 parent 57cce2c commit 35b14ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:
- name: RSpec を実行する
run: |
bundle exec rspec
- name: 最終CSVのエクスポートタスク(全トラックを1ファイルに出力するタスク)を実行する
- name: 最終CSVのエクスポートタスクを実行する
run: |
bundle exec rails export_to_dist_csv_files:all
- name: 最終CSVのエクスポートタスク(アルバムごとに1ファイルに出力するタスク)を実行する
run: |
bundle exec rails export_to_dist_csv_files:each
24 changes: 21 additions & 3 deletions lib/tasks/export_to_dist_csv_files.rake
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
namespace :export_to_dist_csv_files do
desc 'Export to dist CSV files for all albums'
desc 'Export DB to All dist CSV files'
task all: :environment do
Rake::Task['export_to_dist_csv_files:artists'].invoke
Rake::Task['export_to_dist_csv_files:albums'].invoke
Rake::Task['export_to_dist_csv_files:features_all'].invoke
Rake::Task['export_to_dist_csv_files:features_each'].invoke
end

desc 'Export DB to dist artists CSV file'
task artists: :environment do
ExportToDistCsv::ArtistsService.new.execute
end

desc 'Export DB to dist albums CSV file'
task albums: :environment do
ExportToDistCsv::AlbumsService.new.execute
end

desc 'Export DB to dist features CSV file for all albums'
task features_all: :environment do
ExportToDistCsv::FeaturesInAllAlbumsService.new.execute
end

desc 'Export to dist CSV files for each album'
task each: :environment do
desc 'Export DB to dist features CSV files for each album'
task features_each: :environment do
album_names = YAML.load_file(Rails.root.join('db/album_names.yml'))

album_names.each do |album_name|
Expand Down

0 comments on commit 35b14ee

Please sign in to comment.