我有一个这样的 gitlab-ci.yml 文件。在 build-static-pages 作业中,我在脚本中有一个名为“npm test”的命令。我怎样才能以这种“npm 测试”被允许失败的方式构建工作,以便脚本即使在退出代码上也能继续运行,我无法弄清楚,因为我对 CI/CD 非常陌生.
stages:
- build
- test
- deploy-dev
- deploy-qa
- deploy-production
build-static-pages:
stage: build
# image for running Docker in Docker
image: node
script:
# build the static pages with NPM
- npm ci --also=dev #include dev dependencies
- npm test #jest test runner
- npm run-script build #remove dev dependencies
- echo `${CI_PROJECT_DIR}/get_component_version.py` > ${BUILD_DIR}/ver.txt
- ls -alF ${BUILD_DIR}
artifacts:
paths:
- ${BUILD_DIR}
expire_in: 2 weeks