From 671f6a8ca9bca26ee51fde1bad952ac45c5a86d1 Mon Sep 17 00:00:00 2001 From: laysabit Date: Wed, 13 Mar 2024 19:52:41 -0300 Subject: [PATCH] . --- .github/workflows/lint.yml | 20 ++++++++++++-------- .sqlfluff | 2 +- ci_profiles.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 ci_profiles.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 93dc5bd..9ff6835 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,14 +4,14 @@ on: push: branches: - diff-quality -env: - DBT_DEFAULT_PROFILE_TARGET: stellar_dbt_public - DBT_PROFILES_DIR: ${{ github.workspace }} - DBT_TARGET: development - DBT_MAX_BYTES_BILLED: 1000000000000 - DBT_JOB_TIMEOUT: 300 - DBT_THREADS: 1 - DBT_JOB_RETRIES: 1 +# env: +# DBT_DEFAULT_PROFILE_TARGET: stellar_dbt_public +# DBT_PROFILES_DIR: ${{ github.workspace }} +# DBT_TARGET: development +# DBT_MAX_BYTES_BILLED: 1000000000000 +# DBT_JOB_TIMEOUT: 300 +# DBT_THREADS: 1 +# DBT_JOB_RETRIES: 1 jobs: build: @@ -39,6 +39,10 @@ jobs: project_id: crypto-stellar credentials_json: "${{ secrets.CREDS_PROD_HUBBLE }}" + - name: Set up dbt profile + run: | + . ci_profiles.sh + - name: Checkout source branch and diff quality run: | git checkout ${{ github.ref_name }} diff --git a/.sqlfluff b/.sqlfluff index c02e8f9..d645cc8 100644 --- a/.sqlfluff +++ b/.sqlfluff @@ -80,7 +80,7 @@ project_dir = ./ # If your project works only with .env files you need to: ### Change ~/.dbt/ for ./ on profiles_dir variable here ### Remove steps on the pipeline that create and copy the profiles.yml to ~/.dbt/ folder. -profiles_dir = ./ +profiles_dir = ~/.dbt/ # Name of the profiles. # CHANGE THIS TO THE PROFILE NAME ON YOUR PROFILES.YML FILE profile = stellar_dbt diff --git a/ci_profiles.sh b/ci_profiles.sh new file mode 100644 index 0000000..48a31d8 --- /dev/null +++ b/ci_profiles.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +echo "writing file profiles.yml" +mkdir ~/.dbt + +echo "stellar_dbt_public:" >> ~/.dbt/profiles.yml +echo " target: development" >> ~/.dbt/profiles.yml +echo " outputs:" >> ~/.dbt/profiles.yml +echo " development:" >> ~/.dbt/profiles.yml +echo " dataset: crypto_stellar" >> ~/.dbt/profiles.yml +echo " maximum_bytes_billed: 1000000000000" >> ~/.dbt/profiles.yml +echo " job_execution_timeout_seconds: 300" >> ~/.dbt/profiles.yml +echo " job_retries: 1" >> ~/.dbt/profiles.yml +echo " location: us" >> ~/.dbt/profiles.yml +echo " priority: interactive" >> ~/.dbt/profiles.yml +echo " project: crypto-stellar" >> ~/.dbt/profiles.yml +echo " threads: 1" >> ~/.dbt/profiles.yml +echo " type: bigquery" >> ~/.dbt/profiles.yml +echo " method: oauth" >> ~/.dbt/profiles.yml + +dbt deps + +echo "starting dbt docs generate" +dbt docs generate --profiles-dir ~/.dbt