シナリオは次のとおりです。
Docker コンテナーを使用した継続的インテグレーションのプロセスで、localhost:9000 でアプリを提供する実行が必要grunt serve
です。次に、localhost:9000 で提供されるアプリケーションを使用して統合テストを実行する別のコンテナーを実行する必要があります。
私の gitlab.yml ファイル
unit-testing:
image: karma-testing
script:
- npm install && bower install && karma start && grunt serve
cache:
paths:
- node_modules/
- bower_components/
behavior-testing:
image: protractor-ci
script:
- npm install protractor-cucumber-framework cucumber && xvfb-run --server-args='-screen 0 1280x1024x24' protractor protractor.conf.js
cache:
paths:
- node_modules/
- bower_components/
最初のイメージはgrunt serve
、localhost:9000 でアプリを提供するタスクを実行します。2 番目のイメージでは、この実行中のアプリを使用して別のスクリプトを実行する必要があります。