Skip to content

Commit

Permalink
Merge pull request #605 from openedx/jill/rm-dbt-repository-path
Browse files Browse the repository at this point in the history
Removes DBT_REPOSITORY_PATH
  • Loading branch information
Ian2012 authored Feb 16, 2024
2 parents 0abaf39 + 7ed7362 commit be43197
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 48 deletions.
2 changes: 0 additions & 2 deletions tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,6 @@
("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
# make sure packages with versions are enclosed in double quotes
("EXTRA_DBT_PACKAGES", []),
Expand Down
8 changes: 4 additions & 4 deletions tutoraspects/templates/aspects/apps/aspects/scripts/dbt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ ssh -o StrictHostKeyChecking=no [email protected] || true
ssh-add /root/.ssh/id_rsa
{% endif %}

rm -rf {{ DBT_REPOSITORY_PATH }}
rm -rf aspects-dbt

echo "Installing aspects-dbt"
echo "git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }}"
git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }}
git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }} aspects-dbt

cd {{ DBT_REPOSITORY_PATH }} || exit
cd aspects-dbt || exit

export ASPECTS_EVENT_SINK_DATABASE={{ASPECTS_EVENT_SINK_DATABASE}}
export ASPECTS_XAPI_DATABASE={{ASPECTS_XAPI_DATABASE}}
Expand All @@ -33,4 +33,4 @@ dbt deps --profiles-dir /app/aspects/dbt/
echo "Running dbt $*"
dbt "$@" --profiles-dir /app/aspects/dbt/

rm -rf {{ DBT_REPOSITORY_PATH }}
rm -rf aspects-dbt
44 changes: 2 additions & 42 deletions tutoraspects/templates/aspects/jobs/init/aspects/init-aspects.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@
#!/usr/bin/env bash

## WARNING: If you modify this block, make sure to also update the
## corresponding block in the alembic.sh file.
bash /app/aspects/scripts/alembic.sh upgrade head

cd /app/aspects/migrations

alembic upgrade head

cd -

## WARNING: If you modify this block, make sure to also update the
## corresponding block in the dbt.sh file.

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"
echo "git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }}"
git clone -b {{ DBT_BRANCH }} {{ DBT_REPOSITORY }}

cd {{ DBT_REPOSITORY_PATH }} || exit

export ASPECTS_EVENT_SINK_DATABASE={{ASPECTS_EVENT_SINK_DATABASE}}
export ASPECTS_XAPI_DATABASE={{ASPECTS_XAPI_DATABASE}}

echo "Installing dbt dependencies"
dbt deps --profiles-dir /app/aspects/dbt/

echo "Running dbt $*"
dbt run --profiles-dir /app/aspects/dbt/

rm -rf {{ DBT_REPOSITORY_PATH }}
bash /app/aspects/scripts/dbt.sh run

0 comments on commit be43197

Please sign in to comment.