From 5ba32183decae47da3e228555c0d159120e66a8a Mon Sep 17 00:00:00 2001 From: xiuy001 Date: Thu, 5 Jan 2023 16:41:07 -0500 Subject: [PATCH 1/2] updated --- .github/workflows/dbt_run_template_dev.yml | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/dbt_run_template_dev.yml diff --git a/.github/workflows/dbt_run_template_dev.yml b/.github/workflows/dbt_run_template_dev.yml new file mode 100644 index 0000000..ec47cbe --- /dev/null +++ b/.github/workflows/dbt_run_template_dev.yml @@ -0,0 +1,49 @@ +name: dbt_run_template + +on: + workflow_call: + inputs: + environment: + type: string + description: 'environment for dbt command to run' + required: true + dbt_command: + type: string + description: 'dbt commands to run' + required: true + +env: + DBT_PROFILES_DIR: ./ + + ACCOUNT: "${{ secrets.ACCOUNT }}" + ROLE: "${{ secrets.ROLE }}" + USER: "${{ secrets.USER }}" + PASSWORD: "${{ secrets.PASSWORD }}" + REGION: "${{ secrets.REGION }}" + DATABASE: "${{ secrets.DATABASE }}" + WAREHOUSE: "${{ secrets.WAREHOUSE }}" + SCHEMA: "${{ secrets.SCHEMA }}" + +jobs: + run_dbt_jobs: + runs-on: ubuntu-latest + environment: + name: ${{ inputs.environment }} + strategy: + matrix: + command: ${{fromJson(inputs.dbt_command)}} + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v1 + with: + python-version: "3.7.x" + + - name: install dependencies + run: | + pip3 install dbt-snowflake cli_passthrough requests click + dbt deps + - name: Run DBT Jobs + run: | + ${{ matrix.command }} \ No newline at end of file From 2da0575ac714a0951f9e1e08df75c534dcc4ef95 Mon Sep 17 00:00:00 2001 From: xiuy001 Date: Thu, 5 Jan 2023 17:04:16 -0500 Subject: [PATCH 2/2] updated --- .github/workflows/dbt_run_template.yml | 12 +++--- .github/workflows/dbt_run_template_dev.yml | 49 ---------------------- 2 files changed, 7 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/dbt_run_template_dev.yml diff --git a/.github/workflows/dbt_run_template.yml b/.github/workflows/dbt_run_template.yml index cd03cf0..ec47cbe 100644 --- a/.github/workflows/dbt_run_template.yml +++ b/.github/workflows/dbt_run_template.yml @@ -3,6 +3,10 @@ name: dbt_run_template on: workflow_call: inputs: + environment: + type: string + description: 'environment for dbt command to run' + required: true dbt_command: type: string description: 'dbt commands to run' @@ -16,17 +20,15 @@ env: USER: "${{ secrets.USER }}" PASSWORD: "${{ secrets.PASSWORD }}" REGION: "${{ secrets.REGION }}" - DATABASE_DEV: "${{ secrets.DATABASE_DEV }}" - DATABASE_PROD: "${{ secrets.DATABASE_PROD }}" - WAREHOUSE_DEV: "${{ secrets.WAREHOUSE_DEV }}" - WAREHOUSE_PROD: "${{ secrets.WAREHOUSE_PROD }}" + DATABASE: "${{ secrets.DATABASE }}" + WAREHOUSE: "${{ secrets.WAREHOUSE }}" SCHEMA: "${{ secrets.SCHEMA }}" jobs: run_dbt_jobs: runs-on: ubuntu-latest environment: - name: workflow + name: ${{ inputs.environment }} strategy: matrix: command: ${{fromJson(inputs.dbt_command)}} diff --git a/.github/workflows/dbt_run_template_dev.yml b/.github/workflows/dbt_run_template_dev.yml deleted file mode 100644 index ec47cbe..0000000 --- a/.github/workflows/dbt_run_template_dev.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: dbt_run_template - -on: - workflow_call: - inputs: - environment: - type: string - description: 'environment for dbt command to run' - required: true - dbt_command: - type: string - description: 'dbt commands to run' - required: true - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ secrets.ACCOUNT }}" - ROLE: "${{ secrets.ROLE }}" - USER: "${{ secrets.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ secrets.REGION }}" - DATABASE: "${{ secrets.DATABASE }}" - WAREHOUSE: "${{ secrets.WAREHOUSE }}" - SCHEMA: "${{ secrets.SCHEMA }}" - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: ${{ inputs.environment }} - strategy: - matrix: - command: ${{fromJson(inputs.dbt_command)}} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v1 - with: - python-version: "3.7.x" - - - name: install dependencies - run: | - pip3 install dbt-snowflake cli_passthrough requests click - dbt deps - - name: Run DBT Jobs - run: | - ${{ matrix.command }} \ No newline at end of file