From 35b14ee7a1000f6de7c7bd4fe666c6261fb2ade9 Mon Sep 17 00:00:00 2001 From: Osamu Takiya Date: Thu, 7 Dec 2023 11:01:05 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20dist=20CSV=20=E3=82=92?= =?UTF-8?q?=20export=20=E3=81=99=E3=82=8B=E3=82=BF=E3=82=B9=E3=82=AF?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97=E3=81=A6=E5=85=A8=E3=81=A6?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=97=E3=81=9F=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 dist CSV を export するタスクを更新して全てのファイルに対応した * ci: 🎡 タスクの変更に伴い CI も変更した --- .github/workflows/ci.yml | 5 +---- lib/tasks/export_to_dist_csv_files.rake | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d605f58..ab288e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/lib/tasks/export_to_dist_csv_files.rake b/lib/tasks/export_to_dist_csv_files.rake index 125eeb2..9101e90 100644 --- a/lib/tasks/export_to_dist_csv_files.rake +++ b/lib/tasks/export_to_dist_csv_files.rake @@ -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|