brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject git commit: Move node package installs to customize
Date Sun, 07 Sep 2014 03:51:47 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master bbeaa4b9d -> 56a2a7568


Move node package installs to customize


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/56a2a756
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/56a2a756
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/56a2a756

Branch: refs/heads/master
Commit: 56a2a75684a143ce1e1d6e716f3681c6c702125a
Parents: bbeaa4b
Author: Andrew Kennedy <grkvlt@apache.org>
Authored: Sun Sep 7 04:40:39 2014 +0100
Committer: Andrew Kennedy <grkvlt@apache.org>
Committed: Sun Sep 7 04:51:11 2014 +0100

----------------------------------------------------------------------
 .../webapp/nodejs/NodeJsWebAppSshDriver.java    | 13 +++++-----
 .../resources/brooklyn/logback-logger-trace.xml | 26 ++++++++++++++++++++
 2 files changed, 32 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/56a2a756/software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
b/software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
index 3e582fb..12e06c6 100644
--- a/software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
+++ b/software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java
@@ -89,8 +89,7 @@ public class NodeJsWebAppSshDriver extends AbstractSoftwareProcessSshDriver
impl
 
     @Override
     public void install() {
-        List<String> packages = getEntity().getConfig(NodeJsWebAppService.NODE_PACKAGE_LIST);
-        LOG.info("Installing Node.JS {} {}", getEntity().getConfig(SoftwareProcess.SUGGESTED_VERSION),
Iterables.toString(packages));
+        LOG.info("Installing Node.JS {}", getEntity().getConfig(SoftwareProcess.SUGGESTED_VERSION));
 
         List<String> commands = MutableList.<String>builder()
                 .add(BashCommands.INSTALL_CURL)
@@ -102,10 +101,6 @@ public class NodeJsWebAppSshDriver extends AbstractSoftwareProcessSshDriver
impl
                 .add(BashCommands.sudo("n " + getEntity().getConfig(SoftwareProcess.SUGGESTED_VERSION)))
                 .build();
 
-        if (packages != null && packages.size() > 0) {
-            commands.add(BashCommands.sudo("npm install -g " + Joiner.on(' ').join(packages)));
-        }
-
         newScript(INSTALLING)
                 .body.append(commands)
                 .execute();
@@ -115,10 +110,14 @@ public class NodeJsWebAppSshDriver extends AbstractSoftwareProcessSshDriver
impl
     public void customize() {
         List<String> commands = Lists.newLinkedList();
 
+        List<String> packages = getEntity().getConfig(NodeJsWebAppService.NODE_PACKAGE_LIST);
+        if (packages != null && packages.size() > 0) {
+            commands.add(BashCommands.sudo("npm install -g " + Joiner.on(' ').join(packages)));
+        }
+
         String gitRepoUrl = getEntity().getConfig(NodeJsWebAppService.APP_GIT_REPOSITORY_URL);
         String archiveUrl = getEntity().getConfig(NodeJsWebAppService.APP_ARCHIVE_URL);
         String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME);
-
         if (Strings.isNonBlank(gitRepoUrl) && Strings.isNonBlank(archiveUrl)) {
             throw new IllegalStateException("Only one of Git or archive URL must be set for
" + getEntity());
         } else if (Strings.isNonBlank(gitRepoUrl)) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/56a2a756/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
----------------------------------------------------------------------
diff --git a/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
new file mode 100644
index 0000000..a4e5376
--- /dev/null
+++ b/usage/logback-includes/src/main/resources/brooklyn/logback-logger-trace.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<included>
+
+    <!-- enable TRACE logging -->
+    <logger name="brooklyn" level="TRACE"/>
+    <logger name="io.brooklyn" level="TRACE"/>
+      
+</included>


Mime
View raw message