现在我正在使用 Ruby 和 Mongo 开发一个应用程序。但是当我使用 gitlab-ci 部署应用程序时,我陷入了困境,似乎 mongo 服务器没有在 gitlab runner 的测试环境中启动。
这是我的 gitlab-ci.yml
stages :
- test
- deploy
services:
- mongo:latest
unitTest:API:
image: ruby:2.6.10
stage: test
cache:
paths:
- API/vendor/
before_script:
- ruby -v
- gem install bundler --no-ri --no-rdoc
- bundle install --gemfile=API/Gemfile --path vendor
script:
- RAILS_ENV=test rspec API/spec
- RAILS_ENV=test rubocop API
artifacts:
paths:
- coverage/
deploy_coba:
stage: deploy
before_script:
- cd API
script:
- gem install dpl
- dpl --provider=heroku --app=exhibisi-cobacoba --api-key=68b12c2b-cfbc-4478-b943-f26552fb907e
only:
- …Run Code Online (Sandbox Code Playgroud)