Skip to content

Commit 49bb504

Browse files
authored
Merge pull request #69 from manikandan-thangavelu-rl/topic-release
Fix: Nextflow Tower auth token update failure
2 parents bbd7b45 + 44a2afb commit 49bb504

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • products/Nextflow-Advanced/machine-images/config/infra/files/nextflow

products/Nextflow-Advanced/machine-images/config/infra/files/nextflow/set-token

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env bash
22
# Generate auth token
33
AUTH_TOKEN=$(uuidgen)
4+
# Copy update user sql script to a temp file
5+
sudo cp /usr/local/bin/update-user.sql /usr/local/bin/update-user-temp.sql
46
# Replace the generated token in the sql file
5-
sudo sed -i "s/<<AUTH_TOKEN>>/${AUTH_TOKEN}/g" /usr/local/bin/update-user.sql
7+
sudo sed -i "s/<<AUTH_TOKEN>>/${AUTH_TOKEN}/g" /usr/local/bin/update-user-temp.sql
68
echo "Update auth token to user table"
7-
sudo java -cp /usr/local/bin/h2/bin/h2-*.jar org.h2.tools.RunScript -url "jdbc:h2:file:/usr/local/bin/nf-tower/.db/h2/tower" -driver "org.h2.Driver" -user "sa" -password "testpass" -script /usr/local/bin/update-user.sql -showResults
8-
# Replace <<AUTH_TOKEN>> back for it to work on next boot
9-
sudo sed -i "s/${AUTH_TOKEN}/<<AUTH_TOKEN>>/g" /usr/local/bin/update-user.sql
9+
sudo java -cp /usr/local/bin/h2/bin/h2-*.jar org.h2.tools.RunScript -url "jdbc:h2:file:/usr/local/bin/nf-tower/.db/h2/tower" -driver "org.h2.Driver" -user "sa" -password "testpass" -script /usr/local/bin/update-user-temp.sql -showResults
10+
# Remove the temp update user sql script
11+
sudo rm /usr/local/bin/update-user-temp.sql
1012
echo "Auth token updated in db"
1113

1214
#Update SSM parameter with the auth token

0 commit comments

Comments
 (0)