How to run ionic in the background

后端 未结 4 365
执笔经年
执笔经年 2021-01-21 05:06

I am trying to run ionic serve in the background so I can test it via my rails app on circle ci. I thought I could do it with:

nohup bash -c \"ionic serve --noli         


        
4条回答
  •  攒了一身酷
    2021-01-21 05:28

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

    It should be ok to run the command directly before your test:

    ionic serve --nolivereload --nobrowser &
    

    Your CI should kill all the triggered process once its done...

    Update:

    If your CI does not kill the triggered process, you could do something like this:

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

    It should work on CI if all of these commands are in the same job.

提交回复
热议问题