Commit 81abc517 authored by Robert Czechowski's avatar Robert Czechowski

Copy export directory for deployment

parent fcfa2d72
Pipeline #698 passed with stages
in 28 minutes and 31 seconds
......@@ -57,7 +57,7 @@ testdeploy:
# Stop server and upload
- ssh medald@jim.test.bwinf.de "sudo /bin/systemctl stop medal && sudo /bin/systemctl stop medalp && sudo /bin/systemctl stop medal-nachtermin"
- "scp target/release/medal medald@jim.test.bwinf.de:medal/"
- "scp -r migrations static templates medald@jim.test.bwinf.de:medal/"
- "scp -r migrations static templates export medald@jim.test.bwinf.de:medal/"
- "scp -r tasks/jwinf/wrapper.html medald@jim.test.bwinf.de:medal/tasks/jwinf/"
- ssh medald@jim.test.bwinf.de "sudo /bin/systemctl start medal && sudo /bin/systemctl start medalp && sudo /bin/systemctl start medal-nachtermin"
only:
......@@ -78,7 +78,7 @@ deploy:
# Stop server and upload
- ssh medald@jwinf.de "sudo /bin/systemctl stop medal && sudo /bin/systemctl stop medal1"
- "scp target/release/medal medald@jwinf.de:medal/"
- "scp -r migrations static templates medald@jwinf.de:medal/"
- "scp -r migrations static templates export medald@jwinf.de:medal/"
- "scp -r tasks/jwinf/wrapper.html medald@jwinf.de:medal/tasks/jwinf/"
- ssh medald@jwinf.de "sudo /bin/systemctl start medal && sudo /bin/systemctl start medal1"
only:
......
......@@ -921,6 +921,7 @@ impl MedalConnection for Connection {
/* Warning: This function makes no use of rusts type safety. Handle with care when changeing */
fn export_contest_results_to_file(&self, contest_id: i32, taskgroups: &[(i32, String)], filename: &str) {
use std::fs::OpenOptions;
// TODO: what to do, if this fails? Function should be fallible
let file = OpenOptions::new().write(true).create(true).truncate(true).open(filename).unwrap();
let mut headers = vec!["id",
"username",
......@@ -1111,6 +1112,7 @@ impl MedalConnection for Connection {
.unwrap();
let mut taskgroupcontest_iter = taskgroupcontest.into_iter();
// TODO: This can fail
let (mut contest, mut taskgroup, task) = taskgroupcontest_iter.next().unwrap();
taskgroup.tasks.push(task);
for tgc in taskgroupcontest_iter {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment