From a8509060e29400f7c3ec3e9940691afbb6969c7d Mon Sep 17 00:00:00 2001 From: idabblewith <109533655+idabblewith@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:34:15 +0800 Subject: [PATCH] Adjusted alias --- .gitignore | 1 + Dockerfile | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 499e8dfa..6ab450ae 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ extracted_table_data *.csv *.txt *.dump +*.sql *.env extract_data.py diff --git a/Dockerfile b/Dockerfile index aeabce39..448ad148 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,13 @@ RUN echo '# Custom .bashrc modifications\n' \ 'alias home="cd ~"\n' \ 'alias settz="export TZ=$TZ"\n' \ 'alias edit="home && vim .bashrc"\n' \ - 'alias connectdb="PGPASSWORD=$PRODUCTION_PASSWORD psql -h $PRODUCTION_HOST -d $PRODUCTION_DB_NAME -U $PRODUCTION_USERNAME"\n' \ + 'alias dump_prod="PGPASSWORD=$PRODUCTION_PASSWORD pg_dump -h $PRODUCTION_HOST -d $PRODUCTION_DB_NAME -U $PRODUCTION_USERNAME -f prod_dump.sql"\n ' \ + 'alias res_prod="PGPASSWORD=$PRODUCTION_PASSWORD psql -h $PRODUCTION_HOST -d $PRODUCTION_DB_NAME -U $PRODUCTION_USERNAME -a -f prod_dump.sql"\n ' \ + 'alias dump_uat="PGPASSWORD=$UAT_PASSWORD pg_dump -h $PRODUCTION_HOST -d $UAT_DB_NAME -U $UAT_USERNAME -f uat_dump.sql"\n ' \ + 'alias res_uat="PGPASSWORD=$UAT_PASSWORD psql -h $PRODUCTION_HOST -d $UAT_DB_NAME -U $UAT_USERNAME -a -f uat_dump.sql"\n ' \ + 'alias migrate="python manage.py makemigrations && python manage.py migrate"\n ' \ + 'alias connectprod="PGPASSWORD=$PRODUCTION_PASSWORD psql -h $PRODUCTION_HOST -d $PRODUCTION_DB_NAME -U $PRODUCTION_USERNAME"\n' \ + 'alias connectuat="PGPASSWORD=$UAT_PASSWORD psql -h $PRODUCTION_HOST -d $UAT_DB_NAME -U $UAT_USERNAME"\n' \ 'settz\n'>> ~/.bashrc CMD ["gunicorn", "config.wsgi", "--bind", "0.0.0.0:8000"]