Skip to content

Commit

Permalink
Update deploy-on-master-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
heatherbaier authored Mar 19, 2024
1 parent a806e20 commit eb7c23f
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/deploy-on-master-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" [email protected] 'run_commands.sh'
'

0 comments on commit eb7c23f

Please sign in to comment.