lib/tasks/README.md
# Rake tasks
This is an attempt to rein the rake tasks. Some seem old and I'm (pj5) not sure when/where/if they
are used.
Since we will add support scripts here it might be helpful to add comment and RT ticket reference
here for prosterity.
To view all the tasks available, run `bundle exec rails -T`
To view all the support tasks, run `bundle exec rails -T support`
## Contents
<!-- toc -->
- [Un-categorised tasks](#un-categorised-tasks)
- [Add printers and label templates](#add-printers-and-label-templates)
- [Support tasks](#support-tasks)
- [Update library type for given batch](#update-library-type-for-given-batch)
- [Parameters](#parameters)
- [Runnning](#runnning)
- [Confirmation](#confirmation)
- [Related RT tickets](#related-rt-tickets)
<!-- tocstop -->
## Un-categorised tasks
### Add printers and label templates
Adds the printers available from PMB and the label templates needed.
File: [add_templates_and_printers_to_pmb.rake](./add_templates_and_printers_to_pmb.rake)
---
## Support tasks
### Update library type for given batch
Updates the library type of the aliquots for the given batch.
File: [support/update_library_types.rake](./support/update_library_types.rake)
#### Parameters
- `batch_id`: The batch ID - probably in RT ticket
- `library_type_name`: The library type name to update to
#### Runnning
```shell
bundle exec rails "support:update_library_types[<batch_id>,<library_type_name>]"
```
#### Confirmation
Confirm that the MLWH has been updated:
```sql
SELECT
pipeline_id_lims
FROM
iseq_flowcell
WHERE
id_flowcell_lims = <batch_id>;
```
#### Related RT tickets
1. 684348