我有一個gitlab ci的設置,我想要在本地啓動一個本地npm服務器進行測試。我.gitlab-ci.yml
是這樣的:Gitlab持續集成npm後臺進程
stages:
- setup
- build
- test
cache:
paths:
- venv/
- node_modules/
setup_nvm:
stage: setup
script:
- "echo installing npm and 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 I TRY TO RUN THE SERVER IN THE 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"
但是這項工作就停止並setup_python
是從來沒有開始,在狀態pending
永遠。我認爲這些工作會並行執行(根據gitlab runner docs)。你有使用gitlab runner運行後臺任務的經驗嗎?
喬布斯沒有設計這一點,看看['services'](http://docs.gitlab.com/ce/ ci/docker/using_docker_images.html#how-to-use-other-images-as-services) – Martin
@mgansler看起來像提問者沒有使用docker。所以'服務'不能解決問題。 – Fairy