I have a models folder which contains a bunch of sql files models/mart/table1.sql, models/mart/table2.sql, models/mart/table3.sql
I run this command manually on the terminal:
dbt run-operation generate_model_yaml --args '{"model_name": "table1"}'
However, instead of running it individually for each table, I want to include it in the Bitbucket pipeline. How can I modify the command such that it runs in a a loop? It should extract the tablename (filename) for all files from a specified folder (models/mart) and then run the command accordingly by replacing the model_name by the filename each time?
pipelines:
  custom: 
    dbt-run-default:
          - step:
              name: 'Compile'
              image: fishtownanalytics/dbt:1.0.0
              script:
                - cd dbt_4flow
                - dbt deps --profiles-dir ./profiles
 
    