Skip to content

Commit

Permalink
Use tar to transfer source files to remote host
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Nov 24, 2024
1 parent f0db6ff commit adf461b
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ private String getDistCode(Path remoteBase, FederateInstance federate) {
String logDirectory = "~/" + remoteBase + "/" + fileConfig.name + "/log";
String remoteBuildLogFileName = logDirectory + "/build.log";
String buildShellFileName = "build_" + federate.name + ".sh";
String tarFileName = federate.name + ".tar.gz";
return String.join(
"\n",
"echo \"Making directory "
Expand All @@ -443,18 +444,26 @@ private String getDistCode(Path remoteBase, FederateInstance federate) {
+ "; \\",
" date >> " + remoteBuildLogFileName + ";",
"'",
"pushd " + fileConfig.getSrcGenPath() + "/" + federate.name + " > /dev/null",
"echo \"**** Copying source files to host "
+ getUserHost(federate.user, federate.host)
+ "\"",
"scp -r * "
"pushd " + fileConfig.getSrcGenPath() + " > /dev/null",
"echo \"**** Bundling source files into " + tarFileName + "\"",
"tar -czf " + tarFileName + " --exclude build " + federate.name,
"echo \"**** Copying tarfile to host " + getUserHost(federate.user, federate.host) + "\"",
"scp -r "
+ tarFileName
+ " "
+ getUserHost(federate.user, federate.host)
+ ":"
+ remoteBase
+ "/"
+ fileConfig.name
+ "/"
+ federate.name,
+ tarFileName,
"rm " + tarFileName,
"ssh " + getUserHost(federate.user, federate.host) + " '\\",
" cd ~/" + remoteBase + "/" + fileConfig.name + "; \\",
" tar -xzf " + tarFileName + "; \\",
" rm " + tarFileName + ";",
"'",
"popd > /dev/null",
"echo \"**** Generating and executing compile.sh on host "
+ getUserHost(federate.user, federate.host)
Expand Down

0 comments on commit adf461b

Please sign in to comment.