Skip to content

Commit

Permalink
Merge pull request #592 from openedx/cag/private-dbt-repo
Browse files Browse the repository at this point in the history
fix: allow to setup private dbt repository
  • Loading branch information
Ian2012 authored Feb 7, 2024
2 parents 5f6e561 + 947c98d commit 47a6020
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
# flexibility for forking, running branches, specific versions, etc.
("DBT_REPOSITORY", "https://github.com/openedx/aspects-dbt"),
("DBT_BRANCH", "v3.4.1"),
("DBT_SSH_KEY", ""),
# Path to the dbt project inside the repository
("DBT_REPOSITORY_PATH", "aspects-dbt"),
# This is a pip compliant list of Python packages to install to run dbt
Expand Down
9 changes: 9 additions & 0 deletions tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ echo "Installing dbt packages..."

pip install -r /app/aspects/dbt/requirements.txt

{% if DBT_SSH_KEY %}
mkdir -p /root/.ssh
echo "{{ DBT_SSH_KEY}}" | tr -d '\r' > /root/.ssh/id_rsa
chmod 600 /root/.ssh/id_rsa
eval `ssh-agent -s`
ssh -o StrictHostKeyChecking=no [email protected] || true
ssh-add /root/.ssh/id_rsa
{% endif %}

rm -rf {{ DBT_REPOSITORY_PATH }}

echo "Installing aspects-dbt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ echo "Installing dbt packages..."

pip install -r /app/aspects/dbt/requirements.txt

{% if DBT_SSH_KEY %}
mkdir -p /root/.ssh
echo "{{ DBT_SSH_KEY}}" | tr -d '\r' > /root/.ssh/id_rsa
chmod 600 /root/.ssh/id_rsa
eval `ssh-agent -s`
ssh -o StrictHostKeyChecking=no [email protected] || true
ssh-add /root/.ssh/id_rsa
{% endif %}

rm -rf {{ DBT_REPOSITORY_PATH }}

echo "Installing aspects-dbt"
Expand Down

0 comments on commit 47a6020

Please sign in to comment.