From 86d0b1961077ce055a3f25ffafa3ba799d145d60 Mon Sep 17 00:00:00 2001 From: Osamu Takiya Date: Thu, 7 Dec 2023 10:57:59 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20dist=20CSV=20?= =?UTF-8?q?=E3=82=92=20export=20=E3=81=99=E3=82=8B=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97=E3=81=A6=E5=85=A8?= =?UTF-8?q?=E3=81=A6=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/export_to_dist_csv_files.rake | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) 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| From 4e4f0ec1f768382e91d9c42eb4663332bb17ad2d Mon Sep 17 00:00:00 2001 From: Osamu Takiya Date: Thu, 7 Dec 2023 10:59:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=AB=E4=BC=B4=E3=81=84?= =?UTF-8?q?=20CI=20=E3=82=82=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 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