Gitlab Continuous Integration npm Background Process -


i have setup of gitlab ci want start local npm server testing in background. .gitlab-ci.yml like:

stages:   - setup   - build   - test  cache:   paths:     - venv/     - node_modules/  setup_nvm:   stage: setup   script:     - "echo installing npm , phantomjs via nvm"     - "git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`"     - ". ~/.nvm/nvm.sh"     - "nvm install 5.0"     - "nvm use 5.0"     - "npm install"     - "nohup npm run dev &" # here try run server in background  setup_python:   stage: setup   script:     - "echo installing python dependencies in virtual environment"     - "[ ! -d venv ] && virtualenv -p python3 venv"     - "source venv/bin/activate"     - "pip3 install -r requirements.txt"  build_multilang:   stage: build   script:     - "[ ! -d tu9onlinekurstest ] && make -f tools/makefiles/multilang"  do_tests:   stage: test   script:     - "cd src/test"     - "python -m unittest" 

however job halts , setup_python never started , in status pending forever. thought jobs executed in parallel (according gitlab runner docs). have experience in running background tasks gitlab runner?

according tomasz maczukin on a related gitlab issue:

i think best solution use service manager (systemd, runit, upstart, sysv - whatever present on system).

on server should prepare configuration file start service. in ci job e.g. systemctl start tomcat. command expected exit after calling , it's service manager (outside of runner's scope) starts process.

process started runner, if add nohup , & @ end, marked process group id. when job finished runner sending kill signal whole process group. process started directly ci job terminated @ job end. using service manager you're not starting process in context of runner's job. notifying manager start process using prepared configuration :)


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -