-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #605 from openedx/jill/rm-dbt-repository-path
Removes DBT_REPOSITORY_PATH
- Loading branch information
Showing
3 changed files
with
6 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}} | ||
|
@@ -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
44
tutoraspects/templates/aspects/jobs/init/aspects/init-aspects.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |