From eb7c23f479d98a96db2069f78edb0721987806b9 Mon Sep 17 00:00:00 2001 From: Heather Baier <44214106+heatherbaier@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:58:49 -0400 Subject: [PATCH] Update deploy-on-master-push.yml --- .github/workflows/deploy-on-master-push.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-on-master-push.yml b/.github/workflows/deploy-on-master-push.yml index 41c4778..990e2f1 100644 --- a/.github/workflows/deploy-on-master-push.yml +++ b/.github/workflows/deploy-on-master-push.yml @@ -25,19 +25,8 @@ jobs: ls; psql --host=geodb.cfhjsivstphy.us-east-1.rds.amazonaws.com --port=5432 --username=postgres --dbname=geodb; # echo "Another command"; - # Add more commands as needed - - TABLE_PREFIX=khm # This is your dynamic part that you want to inject - - # Use sed to replace a placeholder in the SQL file with the desired table prefix - sed "s/:table_prefix/$TABLE_PREFIX/" create_table_template.sql > create_table.sql - # Now run the modified SQL script - psql --host=geodb.cfhjsivstphy.us-east-1.rds.amazonaws.com --port=5432 --username=postgres --dbname=geodb -f create_table.sql - - # \copy khm_geo FROM /home/ubuntu/data/khm_geo.csv WITH (FORMAT CSV, HEADER true, DELIMITER ',') - - # Copy data from CSV file to the table - psql --host=geodb.cfhjsivstphy.us-east-1.rds.amazonaws.com --port=5432 --username=postgres --dbname=geodb -c "\copy ${TABLE_PREFIX}_geo FROM '/home/ubuntu/data/${TABLE_PREFIX}_geo.csv' WITH (FORMAT CSV, HEADER true, DELIMITER ',')" + # Add more commands as needed + ssh -i "~/.ssh/id_aws.pem" ubuntu@ec2-34-224-89-239.compute-1.amazonaws.com 'run_commands.sh' '