-
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.
Beta-3. Added new method of setup and grabbing files.
Added a new way to setup and have the whole system works. To better protect my sanity, Dr. Hampton suggest going a route of grabbing files using wget from my own www directory, so I don't need to hardcode my password into anything. So, instead of using wget I decided to go with curl as it can easily overwrite files in the process of downloading them which is what we want after-all. Also changed the way the system dies when coming across a bad pending job status (learn something new about uge everyday). Now it will write to a log what the status was that caused the death, instead of mysteriously dying with exit code 20. Updated the readme to reflect new additions. For a cosmetic appeal, I added a faveicon.ico to be displayed on all of the pages. This is the same one found on crc.nd.edu, so if you're an outsider using this repo I'd suggest changing it to what your organization is.
- Loading branch information
Showing
10 changed files
with
188 additions
and
19 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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
#Bash script to gather the html files for a Queuemap webpage. It will grab the files from a web-hosted service, | ||
#like the www directory in my Public afs space. | ||
|
||
#local info: | ||
pswd="LOCAL(SERVER) PASSWORD HERE!!!" #or configure sudoers file | ||
|
||
desired_path="DESIRED PATH FOR SERVER HERE!" #typicaly /var/www/html (you don't need the last '/') | ||
|
||
curl_url="URL FOR CURL GOES HERE" #Don't need last '/' | ||
#Gathering files from CRCFE using wget | ||
|
||
curl -o index-long.html $curl_url/index-long.html | ||
|
||
curl -o index-debug.html $curl_url/index-debug.html | ||
|
||
curl -o pending_content.html $curl_url/pending.html | ||
|
||
curl -o sub-debug.tar.gz $curl_url/sub-debug.tar.gz | ||
|
||
curl -o sub-long.tar.gz $curl_url/sub-long.tar.gz | ||
|
||
#Moving the files once on the web-server to proper locations | ||
|
||
echo $pswd | sudo -S mv index-long.html $desired_path/Long/index-long.html | ||
|
||
echo $pswd | sudo -S mv index-debug.html $desired_path/Debug/index-debug.html | ||
|
||
echo $pswd | sudo -S mv pending_content.html $desired_path/Pending/pending_content.html | ||
|
||
#Setting up node files: | ||
|
||
tar -xzf sub-debug.tar.gz | ||
for i in debug@*; | ||
do | ||
echo $pswd | sudo -S mv $i $desired_path/Debug/$i/sub-index.html | ||
done | ||
|
||
tar -xzf sub-long.tar.gz | ||
for j in d6copt*; | ||
do | ||
echo $pswd | sudo -S mv $j $desired_path/Long/$j/sub-index.html | ||
done |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
#Script to set up the CRC Queue heat-map. Thats what it's called I guess. | ||
#8/3/16 | ||
#Requires sudo permission. This script assumes you have apache2 running and | ||
#php7.0(or something compatible). Default path is listed below. | ||
|
||
#This needs to be an absolute path | ||
desired_path="/var/www/html" #you can change this if need be | ||
|
||
#CRC info to gather files | ||
webpage_url="URL FOR CRC FILES HERE" | ||
|
||
#Local info to mv files to protected areas | ||
psword="LOCAL (WEBSERVER) SUDO PASSWORD" | ||
long_file="long_nodes.txt" #These can stay this way | ||
debug_file="debug_nodes.txt" # " | ||
|
||
#Creating dirs moving files to proper locations | ||
echo "Creating Debug, Long, and Pending directories in $desired_path . . ." | ||
|
||
echo $psword | sudo -S mkdir $desired_path/Debug | ||
echo $psword | sudo -S mkdir $desired_path/Long | ||
echo $psword | sudo -S mkdir $desired_path/Pending | ||
|
||
echo "Moving index's to their rightful places . . ." | ||
echo $psword | sudo -S cp index-long.php $desired_path/Long/index.php | ||
echo $psword | sudo -S cp index-debug.php $desired_path/Debug/index.php | ||
echo $psword | sudo -S cp index-pending.php $desired_path/Pending/index.php | ||
|
||
echo "Transferring templates to $desired_path . . ." | ||
echo $psword | sudo -S cp -r templates $desired_path/templates | ||
|
||
echo "Transferring styles.css to $desired_path . . ." | ||
echo $psword | sudo -S cp styles.css $desired_path/ | ||
|
||
echo "Gathering node-list files from $webpage_url . . ." | ||
curl -o debug_nodes.txt $webpage_url/debug_node_list.html | ||
curl -o long_nodes.txt $webpage_url/long_node_list.html | ||
|
||
# Creating and initialiizing each node's dir etc | ||
#Long-queue nodes | ||
echo "Creating each node's dir at $desired_path/Long . . ." | ||
while IFS= read -r line | ||
do | ||
echo $psword | sudo -S mkdir $desired_path/Long/$line | ||
echo $psword | sudo -S cp sub-index.php $desired_path/Long/$line/index.php | ||
done < "$long_file" | ||
|
||
echo "Creating each node's dir at $desired_path/Debug . . ." | ||
|
||
#Debug-queue nodes | ||
while IFS= read -r line | ||
do | ||
echo $psword | sudo -S mkdir $desired_path/Debug/$line | ||
echo $psword | sudo -S cp sub-index.php $desired_path/Debug/$line/index.php | ||
done < "$debug_file" | ||
|
||
|
||
echo "-----------------------COMPLETE-----------------------" | ||
echo "" | ||
|
||
echo "Setup complete. Please quickly verify everything was made correctly." | ||
echo "You can do this by opening a browser and going to localhost and navigating" | ||
echo "to your Long or Debug directories." | ||
echo "" | ||
echo "Please be sure that the python script is running on a front end, and that" | ||
echo "all scripts are configured to the location the script is going to be spitting" | ||
echo "out at." | ||
echo "" | ||
echo "Once you know things are where they should be, make sure you configured the" | ||
echo "grab_queue_files.sh script for your info to grab the files." | ||
echo "If it is configured already, either of the two lines to crontab -e:" | ||
echo "If you chose method(1) as described in README, add this to cron:" | ||
echo "*/2 * * * * $(pwd)/grab_queue_files.sh" | ||
echo "" | ||
echo "If you chose method(2), add this to cron:" | ||
echo "*/2 * * * * $(pwd)/curl_queue_files.sh" |
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
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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
</div> | ||
<div id="footer"> | ||
<p>v0.8-beta-2</p> | ||
<p>v0.8-beta-3</p> | ||
</div> | ||
</body> | ||
</html> |
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
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
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