brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/4] brooklyn-library git commit: Fixing SuSE Linux support
Date Tue, 03 May 2016 10:22:51 GMT
Fixing SuSE Linux support

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/517e79cb
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/517e79cb
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/517e79cb

Branch: refs/heads/master
Commit: 517e79cb110d3b6644468efd7ae31341c03ef933
Parents: 65171ba
Author: Yavor Yanchev <yavor@yanchev.com>
Authored: Tue Apr 19 17:54:04 2016 +0300
Committer: Yavor Yanchev <yavor@yanchev.com>
Committed: Tue Apr 19 17:54:04 2016 +0300

----------------------------------------------------------------------
 .../nosql/couchdb/CouchDBNodeSshDriver.java     | 35 +++++++++++++++++---
 1 file changed, 31 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/517e79cb/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeSshDriver.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeSshDriver.java
b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeSshDriver.java
index 960bc2b..bb0b52a 100644
--- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeSshDriver.java
+++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeSshDriver.java
@@ -101,15 +101,15 @@ public class CouchDBNodeSshDriver extends AbstractSoftwareProcessSshDriver
imple
        MutableMap<String, String> installPackageFlags = MutableMap.of(
                "yum", "js-devel openssl-devel libicu-devel libcurl-devel erlang-erts erlang-public_key
erlang-eunit erlang-sasl erlang-os_mon erlang-asn1 erlang-xmerl",
                "apt", "erlang-nox erlang-dev libicu-dev libmozjs185-dev libcurl4-openssl-dev",
-               "zypper", "libopenssl-devel pcre-devel",
+               "zypper", "erlang libicu-devel js-devel libopenssl-devel pcre-devel",
                "port", "icu erlang spidermonkey curl");
 
        List<String> cmds = Lists.newArrayList();
 
        cmds.add(BashCommands.INSTALL_TAR);
-       cmds.add(BashCommands.alternatives(
-               BashCommands.ifExecutableElse0("apt-get", BashCommands.installPackage("build-essential")),
-               BashCommands.ifExecutableElse0("yum", BashCommands.sudo("yum -y --nogpgcheck
groupinstall \"Development Tools\""))));
+       cmds.add(BashCommands.ifExecutableElse0("apt-get", BashCommands.installPackage("build-essential")));
+       cmds.add(BashCommands.ifExecutableElse0("yum", BashCommands.sudo("yum -y --nogpgcheck
groupinstall \"Development Tools\"")));
+       cmds.add(BashCommands.ifExecutableElse0("zypper", BashCommands.sudo(getZypperRepository())));
        cmds.add(BashCommands.installPackage(installGccPackageFlags, "couchdb-prerequisites-gcc"));
        cmds.add(BashCommands.installPackage(installMakePackageFlags, "couchdb-prerequisites-make"));
        cmds.add(BashCommands.installPackage(installPackageFlags, "couchdb-prerequisites"));
@@ -214,4 +214,31 @@ public class CouchDBNodeSshDriver extends AbstractSoftwareProcessSshDriver
imple
                 .failOnNonZeroResultCode()
                 .execute();
     }
+
+    private String getZypperRepository() {
+        OsDetails osDetails = getMachine().getMachineDetails().getOsDetails();
+
+        String osMajorVersion = osDetails.getVersion();
+
+        String command = "zypper --non-interactive addrepo -f \"http://download.opensuse.org/repositories/home:/csbuild:/DBA/%1$s/\"
%1$s";
+
+        switch (osMajorVersion) {
+            case "11.4":
+                command = format(command, "SLE_11_SP4");
+                break;
+            case "12.0":
+                command = format(command, "SLE_12");
+                break;
+            case "13.1":
+                command = format(command, "openSUSE_13.1");
+                break;
+            case "13.2":
+                command = format(command, "openSUSE_13.2");
+                break;
+            default:
+                command = "echo UNSUPPORTED SuSE version && exit 1";
+        }
+
+        return command;
+    }
 }


Mime
View raw message