0

I am completely new to donejs and created the donejs app using yeoman, and then created a few components. For deploying the application, I ran "node build" and a dist folder was created, which contained a bundles folder and a steal.production.js file.

What is the way to deploy this dist folder over a nodejs server which basically serves the application and also, I dont want any watching in the console, it should basically just start serving over the port, so that the devops can run scripts after that.

build.js

var stealTools = require("steal-tools");

var buildPromise = stealTools.build({
  config: __dirname + "/package.json!npm"
}, {
  bundleAssets: true
});

From the dist folder :

λ ls
bundles/  steal.production.js

Scripts in my package.json file :

 "scripts": {
    "test": "testee test.html --browsers firefox --reporter Spec",
    "start": "donejs grunt && done-serve --port 8080",
    "grunt": "grunt",
    "develop": "done-serve --develop --port 8080",
    "build": "donejs grunt && donejs develop"
  },

After running donejs start :

C:\Users\saljain\Documents\work\statusui\status\status (master)
λ donejs start

> status@0.0.0 start C:\Users\saljain\Documents\work\statusui\status\status
> donejs grunt && done-serve --port 8080


> status@0.0.0 grunt C:\Users\saljain\Documents\work\statusui\status\status
> grunt

Running "less:development" (less) task
>> 1 stylesheet created.

Done.
done-serve starting on http://localhost:8080

It is serving on 8080 but the console is blocked on this, devops team is saying that the console should not be blocked so that they can run scripts after starting the server.

1 Answers1

0

I can see a start script, so try out donejs start if everything else is in order.

Here's some more options as well according to their docs:

To test the production build: NODE_ENV=production donejs start

https://donejs.com/Guide.html#production-build

syciphj
  • 986
  • 5
  • 11
  • Does the donejs start script picks from the dist folder? – jain.saloni91 Sep 20 '17 at 06:32
  • 1
    Not exactly, it will run what it says after `start` which is `donejs grunt && done-serve --port 8080`. For the matter of which files it will serve is related to some environment configs that are already premade for you. So my edited answer shows how to serve the production build or dist folder. – syciphj Sep 20 '17 at 06:34
  • will it watch the dist folder, because the devops team wants to run some scripts after that? – jain.saloni91 Sep 20 '17 at 06:54
  • 1
    While you set `NODE_ENV=production` it will serve files from dist, but not really watch changes there. Eitherway I don't suggest you add/change files directly to the dist folder as that is really just the optimized/minified output of your build. – syciphj Sep 20 '17 at 07:04
  • is the console blocked on the specific port 8080? If changing the port will help then just edit the port at the start script: `donejs grunt && done-serve --port XXXX` – syciphj Sep 20 '17 at 08:43
  • No, the console is not blocked on that port. I dont want the console to be locked and be able to run other scripts after this. – jain.saloni91 Oct 03 '17 at 15:01
  • Oh you mean after you start the app, you can't do anything anymore. Well that's a common thing when you serve a node app in your terminal. There are different ways to handle this. One way is to use the `screen` command. https://kb.iu.edu/d/acuy You can do your own research about similar things. – syciphj Oct 04 '17 at 01:33
  • Eventually, I used nohup with the comment : nohup donejs build >> a.out & – jain.saloni91 Oct 25 '17 at 12:40