How to run angular CICD on gitlab-runner of wsl?

前提文件

.gitlab-ci.yml, .dockerignore, ci-funcs.sh, Dockerfile, karma.conf.js, nginx.conf, nginx-custom.conf, sonar-project.properties

1.test.ts

const context = require.context('./app/pages', true, /\.spec\.ts$/);

2.sonar-project.properties

sonar.sources=src/app/xxx

sonar.javascript.lcov.reportPaths=coverage/lcov.info

3.karma.conf.js

coverageIstanbulReporter: {

dir: require('path').join(__dirname, './coverage'),

reports: ['html', 'lcovonly', 'text-summary'],

fixWebpackSourcePaths: true

},

4.angular.json

"test": {

...,

"codeCoverage": true

},

5.config.toml

\[runners\]

name = "webapp-angular runner on wsl"

url = "https://gitlab.xxx.com/"

token = "..."

executor = "docker"

runners.custom_build_dir

runners.cache

runners.cache.s3

runners.cache.gcs

runners.cache.azure

runners.docker

tls_verify = false

image = "harbor.xxx.com/base_image/alpine:latest"

privileged = false

disable_entrypoint_overwrite = false

oom_kill_disable = false

disable_cache = false

volumes = ["/data/gitlab-runner/builds:/builds","/data/gitlab-runner/cache:/cache","/var/run/docker.sock:/var/run/docker.sock"]

shm_size = 0

6.CI/CD Settings

Test coverage parsing: Statements.*?(\d+(?:\.\d+)?)%

7.Command

ng test --no-watch --code-coverage

sonar-scanner -Dproject.settings=sonar-project.properties

8.Reference

https://gitlab.xxx.com.cn/xxx/webapp-angular

相关推荐
yaya_1928 小时前
想要PDF翻译保留格式?用对工具是关键
经验分享
草莓熊Lotso9 小时前
《详解 C++ Date 类的设计与实现:从运算符重载到功能测试》
开发语言·c++·经验分享·笔记·其他
Cx330❀21 小时前
【数据结构初阶】--排序(五):计数排序,排序算法复杂度对比和稳定性分析
c语言·数据结构·经验分享·笔记·算法·排序算法
一只拉古1 天前
DevOps 的 Linux 基础(第一部分)
linux·自动化运维·devops
运维开发王义杰1 天前
YAML:锚点深度解析,告别重复,拥抱优雅的配置艺术
ci/cd·gitlab
SirLancelot12 天前
K8s-kubernetes(二)资源限制-详细介绍
微服务·云原生·容器·kubernetes·k8s·devops·kubelet
₯㎕星空&繁华2 天前
Linux-地址空间
linux·运维·服务器·经验分享·笔记
Cx330❀2 天前
【数据结构初阶】--排序(三):冒泡排序、快速排序
c语言·数据结构·经验分享·算法·排序算法
我要学习别拦我~2 天前
读《精益数据分析》:黏性(Stickiness)—— 验证解决方案是否留住用户
经验分享·数据分析
hkNaruto2 天前
【Docker】openEuler 使用docker-compose部署gitlab-ce
docker·容器·gitlab