Skip to content

Commit

Permalink
fix CD script
Browse files Browse the repository at this point in the history
  • Loading branch information
Noel Gomez committed Nov 11, 2023
1 parent 2c7b99b commit 0afeb76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ jobs:
id: prod-manifest
run: "../automate/dbt/get_artifacts.sh"

- name: Generate dbt documentation
run: "dbt docs generate"

- name: Run blue / green deployment
id: run-blue-green
env:
Expand All @@ -66,12 +63,18 @@ jobs:
- name: Delete merged test databases
run: "../automate/dbt/remove_test_databases.sh"

- name: Generate dbt documentation
run: "dbt docs generate"

- name: Deploy docs 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: dbt-docs
folder: transform/target

- name: Upload dbt artifacts
run: "dbt run-operation upload_artifacts"

- uses: fregante/setup-git-user@v2
- name: Bump dbt project and git project version
run: "../automate/dbt/bump_dbt_project.sh"
Expand Down
9 changes: 0 additions & 9 deletions automate/blue_green_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ def main(is_ci_cd_run: bool = False, selector: str = None, target: str = None):
run_command(f'dbt-coves dbt -- run-operation drop_staging_db --args "{STAGING_DB_ARGS}" {dbt_target}')
logging.info("done with dropping!!!!")

# Save the latest manifest to snowflake stage
os.environ["DATACOVES__MAIN__DATABASE"] = DBT_FINAL_DB_NAME
run_command(f"dbt-coves dbt -- compile {dbt_target}")

os.environ["DATACOVES__MAIN__DATABASE"] = DBT_FINAL_DB_NAME

logging.info("Uploading new prod manifest")
run_command(f"dbt-coves dbt -- --no-write-json run-operation upload_artifacts {dbt_target}")


def run_dbt(selector: str = None, dbt_target: str = None, is_ci_cd_run: bool = False):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

{# Macro for deleting objects from the data warehouse that are no longer in dbt. #}
{#
dbt run-operation drop_orphanate_relations --args '{"dry_run": true}'
dbt run-operation drop_orphaned_relations --args '{"dry_run": true}'
#}

{%- macro drop_orphanate_relations(dry_run='true') -%}
{%- macro drop_orphaned_relations(dry_run='true') -%}

{%- if execute -%}

Expand Down

0 comments on commit 0afeb76

Please sign in to comment.