【发布时间】:2020-11-11 17:25:18
【问题描述】:
对于“部署”阶段,我需要一个代理。但是阶段“测试”从业力测试开始的地方不起作用。有没有办法,我可以定义:使用代理设置阶段“部署”而不是“测试”?
我试图从代理中排除 Karma 正在使用的 IP,但 Ip 每次都在变化。
variables:
http_proxy: "$CODE_PROXY"
https_proxy: "$CODE_PROXY"
no_proxy: "127.0.0.1,localhost"
stages:
- test
- deploy
test:
stage: test
image: node:erbium
services:
- selenium/standalone-chrome:3.141.59
script:
- npm ci
- npm run lint
- npm run lint:sass
- npm run lint:editorconfig
- npm run test -- --progress=false --code-coverage
- npm run e2e -- --host=$(hostname -i)
- npm run build:prod -- --progress=false
coverage: '/Statements\s*:\s*(\d+\.?\d+)\%/'
artifacts:
expire_in: 3h
paths:
- dist/
reports:
junit: dist/reports/app-name/test-*.xml
cobertura: dist/coverage/app-name/cobertura-coverage.xml
tags:
- DOCKER
deploy:
stage: deploy
image: python:latest
script:
- pip install awscli
- aws s3 rm s3://$S3_BUCKET_NAME --recursive
- aws s3 cp ./dist/app-name s3://$S3_BUCKET_NAME/ --recursive
only:
- master
【问题讨论】:
标签: docker continuous-integration gitlab gitlab-ci