File size: 1,129 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env perl

use strict;

my $HOME = $ENV{"HOME"};
my $HOSTNAME = "s0565741\@thor.inf.ed.ac.uk";

my $sriPath = $ARGV[0];

my $cmd;

# what machine
my $machine = `uname`;
chomp($machine);

# COMPILE
$cmd = "git checkout master && git pull";
print STDERR "Executing: $cmd \n";
system($cmd);

$cmd = "make -f contrib/Makefiles/install-dependencies.gmake && ./compile.sh --without-tcmalloc";
print STDERR "Executing: $cmd \n";
system($cmd);

#ZIP
if ($machine eq "Darwin") {
  $machine = "mac";
}

$cmd = "mkdir -p mt-tools/moses && mv bin lib mt-tools/moses";
print STDERR "Executing: $cmd \n";
system($cmd);

$cmd = "tar -zcvf $machine.tgz mt-tools";
print STDERR "Executing: $cmd \n";
system($cmd);

# UPLOAD
my $date = `date "+%F"`;
chomp($date);

my $targetDir = "/fs/thor1/hieu/binaries/$date/";
print STDERR "Directory=$targetDir\n";

$cmd = "ssh $HOSTNAME mkdir -p $targetDir";
print STDERR "Executing: $cmd \n";
system($cmd);

$cmd = "rsync -rv --delete $machine.tgz $HOSTNAME:$targetDir";
print STDERR "Executing: $cmd \n";
system($cmd);

$cmd = "rm $machine.tgz";
print STDERR "Executing: $cmd \n";
system($cmd);