-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a806e20
commit eb7c23f
Showing
1 changed file
with
2 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
' |