Running gulp as a service - nginx

We have a project where the developers (from what I understand) use gulp to run a website locally using Vagrant. They want to deploy this website on an AWS instance.
We are trying to implement the commands using Jenkins. The website stays up while gulp serve-dev is running, but then Jenkins times out and Nginx returns a 502 error. Of course we can prevent Jenkins from timing out but then the job would need to keep running.
Is there away to run this command as a service? any other way we can go about this ?

You want to run gulp in the backgroud without stoppping when you close terminal or log out from the server.
Try using nohup(short for no hangup) which runs command with hangup ignored so that your command continue running even if you logout from the server
try running it using nohup gulp serve-dev &
& put command in background mode so that you can continue using the current shell screen.
Cheers!

Related

.net core console application on PCF

I'm able to deploy a .net core console app on PCF which raises some internal events and runs for sometime(with help of Thread.Delay()) and exits. I want to be able to start and stop this app remotely, using a batch file from windows machine.
When I push this app to PCF I have explicitly put --no-start flag in the push command. The app gets deployed and doesn't starts and I can start this remotely with cf start command. Once it exits successfully PCF tries to restart it considering it as crashed so in order to restart i would first need to cf stop and then use start command.
I need help in understanding - if there is any other better way to do this. Originally we were planning to use Tasks on PCF; but as per my understanding Tasks are command which runs on other application(please correct me if I am wrong)
Any thoughts will help.
Thanks in advance.
I modified my app logic to achieve this. I did the following -
Deployed app with --no-start flag
In the app entry method I checking the value of arg passed from command line
if arg==required_key then run the job else return
I do a cf start which builds, stages the app and the app gets started but no results displayed on console
cf stop
cf run-task APP_NAME "dotnet appname.dll required_key"
The above task runs one time and destroys itself.

Jenkins freezes on build job, unable to ssh into virtual server to restart

I'm new to Jenkins and it's hanging on a build job. I've read that a restart is in order. Unfortunately, I can't access the command line because the operation times out when I try to ssh into the virtual server. The server is running on Nginx/Ubuntu.
Is there anything I can do besides doing a hard reset of the server?
Try using SafeRestart plugin or just restart Jenkins manually as described here.

KIBANA 4 process gets stopped on closing the putty window

I am using kibana-4.0.0-beta3 version on linux machine. The process gets stopped automatically on closing the putty window. Is there any way to run the process in back-end?
Yes. As with any unix process, the basics would be to use 'nohup' and put the process in the background. You should write a startup script (e.g. /etc/init.d/kibana4) that is similar in form to other startup scripts on your system.
Here is a kibana4 startup script for debian, simply place it in /etc/init.d/kibana , then run:
/etc/init.d/kibana start
set it to start on boot:
update-rc.d kibana defaults
https://github.com/akabdog/scripts/blob/master/kibana4_init
Use a program called screen to run anything in a shell. Then detach from the terminal session but keep the processes running. When you reconnect you can reconnect to the session and interact with them.
Run with nohup
nohub ./bin/kibana
bin/kibana > abc.txt &
This will run kibana in backend and redirect its logs to abc.txt. works like a charm for me :-)

Running a meteor.js application forever

I have a personal localhost meteor application running on my laptop which silently stops running every time the computer goes to sleep. The way I run it simply using the "meteor" command, after which i background and disown the process and close terminal.
Is there a way to prevent the app from stopping, to have it run forever on my machine unless i explicitly close it?
You need to create a server daemon for your application in the same way you'd do on a production server. There are several ways to do this, probably the easiest one is to use demeteorizer to create a plain Node.js program with your app, and then run it with forever.

Running a java file from grunt, doesnt open Port for Browserstack

I am running the BrowserStackTunnel.jar by the grunt plugin grunt-exec
(Have been using node's child_process.exec, but same results)
with the command java -jar BrowserStackTunnel.jar -force APIKEY localhost,8000,false
What the Java file actualy does is connecting via ssh to an Amazon instance of Browserstack and opening a port on 45691, the website of browserstack is polling that port on localhost where the Java application serves a small snippet containing the params passed.
If i run the command from the CLI it works fine and i see the port beeing open on netstat. In the browserstack website i get the success screen.
But if i run the command from grunt-exec it shows only the SYN request.
The output to the command line is the same, both show success
I am not so sure what is causing this. I am running on windows7, node v0.10.12, grunt-cli v0.1.9, grunt v0.4.1 and grunt exec v0.4.2
Any idea what is causing this or how to debug it? I thought about a permission problem, but i am kind of clueless
I had the same problem and I realized, better if I use the BrowserStackLocal binary files for creating a tunel. I solved a quite complex configuration here: Ember.js - CircleCI - BrowserStack
BrowserStackLocal files are here: http://www.browserstack.com/local-testing (Binaries)
Have you tried using the Browserstack Chrome Plugin? It was launched this january and allows you to test local files without running the cli tunnel.
As soon as the child process is created, grunt moves on to the next command. If there is nothing, the grunt process terminates and takes the child with it.
Try adding a grunt-contrib-watch task after the grunt-exec call. It should keep the grunt process alive, and the child process with it.

Resources