Repository: airavata
Updated Branches:
  refs/heads/develop c3262a093 -> bb3d4786c


setting export commands to the Groovy context


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/bb3d4786
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/bb3d4786
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/bb3d4786

Branch: refs/heads/develop
Commit: bb3d4786c5e5c50f8be433c8efb7860a45b8f7a7
Parents: c3262a0
Author: scnakandala <[email protected]>
Authored: Fri Aug 18 10:31:16 2017 -0400
Committer: scnakandala <[email protected]>
Committed: Fri Aug 18 10:31:16 2017 -0400

----------------------------------------------------------------------
 .../java/org/apache/airavata/gfac/core/GFacUtils.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/bb3d4786/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git 
a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
 
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index eb8530b..3a68490 100644
--- 
a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ 
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -31,6 +31,7 @@ import org.apache.airavata.gfac.core.context.TaskContext;
 import org.apache.airavata.messaging.core.MessageContext;
 import 
org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appdeployment.CommandObject;
+import org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths;
 import org.apache.airavata.model.appcatalog.computeresource.*;
 import 
org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import org.apache.airavata.model.application.io.DataType;
@@ -534,6 +535,16 @@ public class GFacUtils {
         }
 
         ApplicationDeploymentDescription appDepDescription = 
processContext.getApplicationDeploymentDescription();
+
+        List<SetEnvPaths> exportCommands = 
appDepDescription.getSetEnvironment();
+        if (exportCommands != null) {
+            List<String> exportCommandList = exportCommands.stream()
+                    .sorted((e1, e2) -> e1.getEnvPathOrder() - 
e2.getEnvPathOrder())
+                    .map(map -> "export " + map.getName() + "=" + 
map.getValue())
+                    .collect(Collectors.toList());
+            groovyMap.add(Script.EXPORTS, exportCommandList);
+        }
+
         List<CommandObject> moduleCmds = appDepDescription.getModuleLoadCmds();
         if (moduleCmds != null) {
             List<String> modulesCmdCollect = moduleCmds.stream()

Reply via email to