Commit d950c694 authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

fix: move dbt deps command from before_script to script

parent d6ca2b87
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -435,7 +435,6 @@ stages:
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
    - assert_defined "${DBT_ADAPTER}" 'Missing required dbt adapter'
    - install_requirements
    - dbt deps --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}"
  # Cache downloaded dependencies and plugins between builds.
  cache:
    # cache shall be per branch per template
@@ -462,6 +461,7 @@ dbt-sqlfluff-lint:
  script:
    - assert_defined "${ENV_TARGET:-${DBT_TARGET}}" 'Missing required dbt target'
    - mkdir -p ${DBT_PROJECT_DIR}/reports
    - dbt deps --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}"
    - dbt compile --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}" --target "${ENV_TARGET:-${DBT_TARGET}}" ${DBT_BUILD_ARGS}
    - dbt docs generate --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}" --target "${ENV_TARGET:-${DBT_TARGET}}" --no-compile ${DBT_BUILD_ARGS}
    - dbt-coverage compute doc --project-dir "${DBT_PROJECT_DIR}" --cov-report ${DBT_PROJECT_DIR}/reports/dbt-coverage.native.json
@@ -522,6 +522,7 @@ dbt-build-production:
  needs: []
  script:
    - mkdir -p ${DBT_PROJECT_DIR}/reports
    - dbt deps --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}"    
    - dbt test --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}" ${DBT_TEST_ARGS}
    - dbt_junit_report ${DBT_PROJECT_DIR}/target/run_results.json ${DBT_PROJECT_DIR}/reports/dbt-test.xunit.xml
  # keep build artifacts and test reports (see: https://docs.gitlab.com/ee/ci/yaml/#artifactsreportsjunit)
@@ -610,6 +611,7 @@ dbt-test-production:
  extends: .dbt-base
  stage: deploy
  script:
    - dbt deps --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}"
    - dbt build --project-dir "${DBT_PROJECT_DIR}" --profiles-dir "${DBT_PROFILES_DIR}" --target "${ENV_TARGET:-${DBT_TARGET}}" ${DBT_BUILD_ARGS}
  # keep build artifacts and test reports (see: https://docs.gitlab.com/ee/ci/yaml/#artifactsreportsjunit)
  # artifacts: