How to run ion in the background

I am trying to run ionic feed in the background to test it through the rails app on ci circle. I thought I could do this with:

nohup bash -c "ionic serve --nolivereload --nobrowser &" 

But unfortunately, this will not work. Does anyone know how to run it in the background?

+2
source share
4 answers

You can use screen :

 screen -d -m -L ionic serve --nolivereload --nobrowser 
+6
source

Why do you want it to run in the background on CI?

It should be ok to run the command just before the test:

 ionic serve --nolivereload --nobrowser & 

Your CI should kill the entire initiated process after it is completed ...

Update:

If your CI does not kill the called process, you can do something like this:

 ionic serve --nolivereload --nobrowser & ionicpid=$! your_test_command_here kill -15 $ionicpid 

It should work on CI if all these commands are in one task.

+2
source

In CircleCI, I found that this setting works well

 machine: node: version: v7.4.0 test: pre: - npm run webdriver-update - ionic serve --nolivereload --nobrowser --port 8101: background: true - sleep 15 override: - npm run e2e 
0
source

Here is a method that really works (sorry so late)

 sleep 999999999 | ionic serve -b & 

I think there is an easy way in ionic v3, but this works for v1

0
source

All Articles