version: 1
default_environment: dev
project_id: 88fd1a48-b28c-4bc4-80b2-3751e2915aff
jobs:
  build:
  - - tap-rickandmorty target-bigquery
    - tap-strava target-bigquery
    - tap-spotify target-bigquery
  - dbt-bigquery:run
  - dbt-bigquery:test
  - evidence:build
plugins:
  extractors:
  - name: tap-bigquery
    variant: anelendata
    pip_url: tap-bigquery
  - name: tap-carbon-intensity
    variant: meltano
    pip_url: git+https://gitlab.com/meltano/tap-carbon-intensity.git
  - name: tap-spotify
    namespace: tap_spotify
    pip_url: git+https://github.com/Matatika/tap-spotify.git
    executable: tap-spotify
    capabilities:
    - catalog
    - discover
    - state
    settings:
    - name: client_id
      kind: password
    - name: client_secret
      kind: password
    - name: refresh_token
      kind: password
  - name: tap-strava
    namespace: tap_strava
    pip_url: git+https://github.com/briansloane/tap-strava.git
    executable: tap-strava
    capabilities:
    - catalog
    - discover
    - state
    settings:
    - name: start_date
      kind: date_iso8601
    - name: client_id
      kind: password
    - name: client_secret
      kind: password
    - name: access_token
      kind: password
    - name: refresh_token
      kind: password
    - name: code
      kind: password
      description: Authorization code for the specific athlete. https://developers.strava.com/docs/getting-started
    config:
      start_date: '2022-01-01'
  - name: tap-openweathermap
    namespace: tap_openweathermap
    pip_url: git+https://github.com/Matatika/tap-openweathermap.git
    executable: tap-openweathermap
    capabilities:
    - catalog
    - discover
    - state
    settings:
    - name: api_key
      kind: password
    - name: current_weather_city_name
      kind: string
    - name: forecast_weather_longitude
      kind: string
    - name: forecast_weather_lattitude
      kind: string
    config:
      current_weather_city_name: Seattle
      forecast_weather_lattitude: '122'
      forecast_weather_longitude: '47'
  - name: tap-rickandmorty
    namespace: tap_rickandmorty
    pip_url: git+https://github.com/aaronsteers/tap-rickandmorty.git
    executable: tap-rickandmorty
    capabilities:
    - catalog
    - discover
    - state
  - name: tap-smoke-test
    namespace: tap_smoke_test
    pip_url: git+https://gitlab.com/meltano/tap-smoke-test.git
    executable: tap-smoke-test
    capabilities:
    - catalog
    - discover
    - state
    config:
      streams:
      - stream_name: animals
        input_filename: https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/animals-data.jsonl
        loop_count: 3
      - stream_name: pageviews
        input_filename: https://gitlab.com/meltano/tap-smoke-test/-/raw/main/demo-data/pageviews-data.jsonl
  loaders:
  - name: target-bigquery
    variant: adswerve
    pip_url: git+https://github.com/adswerve/target-bigquery.git@0.11.3
    config:
      add_metadata_columns: true
      credentials_path: $WAREHOUSE_CREDENTIALS_PATH
      project_id: $WAREHOUSE_DATABASE
  - name: target-jsonl
    variant: andyh1203
    pip_url: target-jsonl
  transforms:
  - name: tap-carbon-intensity
    variant: meltano
    pip_url: https://gitlab.com/meltano/dbt-tap-carbon-intensity.git@config-version-2
  transformers:
  - name: dbt-bigquery
    executable: dbt
    namespace: dbt_bigquery
    docs: https://docs.meltano.com/guide/transformation
    repo: https://github.com/dbt-labs/dbt-core
    pip_url: dbt-core~=1.0.0 dbt-bigquery~=1.0.0
    settings:
    - name: project_dir
      value: $MELTANO_PROJECT_ROOT/transform
    - name: profiles_dir
      value: $MELTANO_PROJECT_ROOT/transform/profiles/bigquery
      env_aliases:
      - DBT_PROFILES_DIR
      # BigQuery connection settings are set via `config:` blocks and mapped to `profiles.yml`
    - name: method
      kind: string
      description: |
        The auth method to use. One of: "oauth", "oauth-secrets", or "service-account"
    - name: project
      kind: string
      description: |
        The BigQuery project ID.
    - name: dataset
      kind: string
      description: |
        The dataset to use.
    - name: refresh_token
      kind: password
      description: |
        The refresh token, if authenticating via oauth-secrets method.
    - name: client_id
      kind: string
      description: |
        The client id to use, if authenticating via oauth-secrets method.
    - name: client_secret
      kind: password
      description: |
        The client secret to use, if authenticating via oauth-secrets method.
    - name: token_uri
      kind: string
      description: |
        The token redirect URI
    - name: keyfile
      kind: string
      description: |
        The path to the keyfile.json to use, if authenticating via service-account method.
    commands:
      clean:
        args: clean
        description: Delete all folders in the clean-targets list (usually the dbt_modules and target directories.)
      compile:
        args: compile
        description: Generates executable SQL from source model, test, and analysis files. Compiled SQL files are written to the target/ directory.
      deps:
        args: deps
        description: Pull the most recent version of the dependencies listed in packages.yml
      run:
        args: run
        description: Compile SQL and execute against the current target database.
      seed:
        args: seed
        description: Load data from csv files into your data warehouse.
      snapshot:
        args: snapshot
        description: Execute snapshots defined in your project.
      test:
        args: test
        description: Runs tests on data in deployed models.
    config:
      method: service-account
      project: $WAREHOUSE_DATABASE
      dataset: $WAREHOUSE_SCHEMA
      keyfile: $WAREHOUSE_CREDENTIALS_PATH
  utilities:
  - name: evidence
    namespace: evidence
    commands:
      pull_image:
        # https://github.com/evidence-dev/docker-devenv
        args: pull evidencedev/devenv:latest
        executable: docker
      help:
        args: ""
        container_spec:
          image: evidencedev/devenv:latest
          command: --help
          volumes:
          - $MELTANO_PROJECT_ROOT/analyze/evidence/:/evidence-workspace/
      init:
        args: ""
        container_spec:
          image: evidencedev/devenv:latest
          command: init
          volumes:
          - $MELTANO_PROJECT_ROOT/analyze/evidence/:/evidence-workspace/
      dev:
        args: ""
        container_spec:
          image: evidencedev/devenv:latest
          ports:
            '3000': '3000'
          volumes:
          - $MELTANO_PROJECT_ROOT/analyze/evidence/:/evidence-workspace/
      install:
        args: "install"
        container_spec:
          image: evidencedev/devenv:latest
          command: npm install
          volumes:
          - $MELTANO_PROJECT_ROOT/analyze/evidence/:/evidence-workspace/
      build:
        # Not working yet
        args: ""
        container_spec:
          image: evidencedev/devenv:latest
          command: npm run build
          volumes:
          - $MELTANO_PROJECT_ROOT/analyze/evidence/:/evidence-workspace/
      bash:
        # Doesn't seem to work yet, missing interactive mode flag (-i).
        # Instead run:
        # > docker run -it --rm -v $(pwd)/:/evidence-workspace/ evidencedev/devenv:latest bash
        args: ""
        container_spec:
          image: evidencedev/devenv:latest
          command: bash
          volumes:
          - $MELTANO_PROJECT_ROOT/analyze/evidence/:/evidence-workspace/
schedules:
- name: test-carbon-intensity-to-bigquery
  extractor: tap-carbon-intensity
  loader: target-bigquery
  transform: skip
  interval: '@once'
  start_date: 2022-04-17 20:31:19.009856
- name: strava-to-bigquery
  extractor: tap-strava
  loader: target-bigquery
  transform: skip
  interval: '@once'
  start_date: 2022-01-01 00:00:00
- name: openweathermap-to-bigquery
  extractor: tap-openweathermap
  loader: target-bigquery
  transform: skip
  interval: '@once'
  start_date: 2022-04-18 08:19:20.272061
environments:
- name: dev
  env:
    WAREHOUSE_DATABASE: aj-dataops-personal
    WAREHOUSE_SCHEMA: marts
    WAREHOUSE_CREDENTIALS_PATH: /Users/aj/Source/aj-dataops-personal/client_secrets.json
- name: staging
- name: prod
