Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 dist CSV を export するタスクを更新して全てのファイルに対応した #72

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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