我有一个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