You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by bostko <gi...@git.apache.org> on 2015/04/22 19:58:23 UTC

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

GitHub user bostko opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/612

    Nodejs riak sample app

    - Refactoring the NodeJsWebAppSshDriver .
    Install packages from package.json as non-root

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bostko/incubator-brooklyn riak-nodejs-app

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/612.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #612
    
----
commit e0b488d2834d8661a1622dd45e1a11fb02da3fe9
Author: Valentin Aitken <va...@cloudsoftcorp.com>
Date:   2015-04-22T17:56:49Z

    Nodejs riak sample app
    
    - Refactoring the NodeJsWebAppSshDriver
    install packages from package.json as non-root

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/612#discussion_r29047866
  
    --- Diff: software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java ---
    @@ -103,6 +103,7 @@ public void install() {
                             BashCommands.installPackage("software-properties-common python-software-properties python g++ make"),
                             BashCommands.sudo("add-apt-repository ppa:chris-lea/node.js"))))
                     .add(BashCommands.installPackage(MutableMap.of("yum", "git nodejs npm", "apt", "git-core nodejs"), null))
    +                .add("npm install n") // Create ~/.npm as the current user instead of root
    --- End diff --
    
    I thought that global install was not recommended, should use normal when possible? Not a NodeJS expert though so might as well be wrong.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/612#issuecomment-100902621
  
    @bostko Thanks, will merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/612#issuecomment-95934335
  
    Looks good, minor comments only.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by bostko <gi...@git.apache.org>.
Github user bostko commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/612#discussion_r29048593
  
    --- Diff: software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java ---
    @@ -128,12 +124,19 @@ public void customize() {
                 throw new IllegalStateException("Only one of Git or archive URL must be set for " + getEntity());
             } else if (Strings.isNonBlank(gitRepoUrl)) {
                 commands.add(String.format("git clone %s %s", gitRepoUrl, appName));
    +            commands.add(String.format("cd %s", appName));
             } else if (Strings.isNonBlank(archiveUrl)) {
                 ArchiveUtils.deploy(archiveUrl, getMachine(), getRunDir());
             } else {
                 throw new IllegalStateException("At least one of Git or archive URL must be set for " + getEntity());
             }
     
    +        commands.add(BashCommands.ifFileExistsElse1("package.json", "npm install"));
    +        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)));
    --- End diff --
    
    What would you say to remove sudo here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-brooklyn/pull/612


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/612#discussion_r29048447
  
    --- Diff: software/webapp/src/main/java/brooklyn/entity/webapp/nodejs/NodeJsWebAppSshDriver.java ---
    @@ -103,6 +103,7 @@ public void install() {
                             BashCommands.installPackage("software-properties-common python-software-properties python g++ make"),
                             BashCommands.sudo("add-apt-repository ppa:chris-lea/node.js"))))
                     .add(BashCommands.installPackage(MutableMap.of("yum", "git nodejs npm", "apt", "git-core nodejs"), null))
    +                .add("npm install n") // Create ~/.npm as the current user instead of root
    --- End diff --
    
    If it's just to create the folder, then create it explicitly, instead of installing the package locally and globally twice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: Nodejs riak sample app

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/612#discussion_r29047971
  
    --- Diff: examples/simple-web-cluster/src/main/resources/brooklyn/demo/nodejs-riak-todo.yaml ---
    @@ -0,0 +1,46 @@
    +# 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.
    +
    +name: "Node.JS Todo Application"
    +origin: "https://github.com/amirrajan/nodejs-todo/"
    --- End diff --
    
    I think this is where the blueprint lives, not where the app is forked from. Not important though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---