Skip to content

Commit

Permalink
Variable change
Browse files Browse the repository at this point in the history
  • Loading branch information
jrpatterson committed May 3, 2024
1 parent d004059 commit 9584552
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/jobs/lionpath_integrate_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def create_tmp_file(params, user_uploaded)
else
# Running bash script to grab lionpath files
username = Rails.application.config_for(:activity_insight)['lp_sftp'][:username]
sftphost = Rails.application.config_for(:activity_insight)['lp_sftp'][:sftphost]
`LP_SFTP_USERNAME=#{username} LP_SFTP_HOSTNAME=#{sftphost} #{Rails.root}/bin/courses-taught.sh`
host = Rails.application.config_for(:activity_insight)['lp_sftp'][:host]
`LP_SFTP_USERNAME=#{username} LP_SFTP_HOSTNAME=#{host} #{Rails.root}/bin/courses-taught.sh`

This comment has been minimized.

Copy link
@whereismyjetpack

whereismyjetpack May 3, 2024

Contributor

we should set these to FAMS_LP_SFTP_USERNAME and FAMS_LP_SFTP_PASSWORD so that they work inside and outside of the rake task

File.join('app', 'parsing_files', 'courses_taught.csv')
end
end
Expand Down
6 changes: 3 additions & 3 deletions bin/courses-taught.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

# Get username from env variable
USERNAME=${LP_SFTP_USERNAME}
SFTPHOST=${LP_SFTP_HOSTNAME}
HOST=${LP_SFTP_HOSTNAME}

# Using SFTP connection with Lionpath host to pull file names in order of most to least recent
OUTPUT=$(sftp -P 22 -b bin/lp_sftp_newest.bat -i ~/.ssh/id_rsa_lionpath_prod $USERNAME@$SFTPHOST)
OUTPUT=$(sftp -P 22 -b bin/lp_sftp_newest.bat -i ~/.ssh/id_rsa_lionpath_prod $USERNAME@$HOST)

# Single out the first PE_RP_ACTIVITY_INSIGHT and pull this down as app/parsing_files/courses_taught.csv
for x in $OUTPUT
do
if [[ "$x" =~ "PE_RP_ACTIVITY_INSIGHT" ]]; then
sftp -P 22 -r -i ~/.ssh/id_rsa_lionpath_prod $USERNAME@$SFTPHOST:/out/$x app/parsing_files/courses_taught.csv
sftp -P 22 -r -i ~/.ssh/id_rsa_lionpath_prod $USERNAME@$HOST:/out/$x app/parsing_files/courses_taught.csv
break
fi
done
2 changes: 1 addition & 1 deletion config/activity_insight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ production:
api_key: "<%= ENV.fetch('FAMS_S3_BUCKET_API_KEY') %>"
lp_sftp:
username: "<%= ENV.fetch('FAMS_LP_SFTP_USERNAME') %>"
sftphost: "<%= ENV.fetch('FAMS_LP_SFTP_HOSTNAME') %>"
host: "<%= ENV.fetch('FAMS_LP_SFTP_HOSTNAME') %>"
6 changes: 3 additions & 3 deletions config/activity_insight.yml.circleci
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ production:
api_key: "fake"
lp_sftp:
username: "fake"
sftphost: "fake"
host: "fake"

development:
main:
Expand All @@ -32,7 +32,7 @@ development:
api_key: "fake"
lp_sftp:
username: "fake"
sftphost: "fake"
host: "fake"

test:
main:
Expand All @@ -50,4 +50,4 @@ test:
api_key: "fake"
lp_sftp:
username: "fake"
sftphost: "fake"
host: "fake"

0 comments on commit 9584552

Please sign in to comment.