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

相关推荐
zy张起灵3 小时前
48v72v-100v转12v 10A大功率转换电源方案CSM3100SK
经验分享·嵌入式硬件·硬件工程
Kkooe8 小时前
GitLab|GitLab报错:Restoring PostgreSQL database gitlabhq_production...
gitlab
努力的小雨14 小时前
零基础入门gRPC:从 0 实现一个Hello World
经验分享
有过~15 小时前
XviD4PSP视频无损转换器
经验分享·电脑
催催1219 小时前
手机领夹麦克风哪个牌子好,哪种领夹麦性价比高,热门麦克风推荐
网络·人工智能·经验分享·其他·智能手机
小柒xq1 天前
使用docker compose安装部署gitlab
docker·容器·gitlab
桥豆麻袋93931 天前
Sourcetree登录GitLab账号
linux·服务器·gitlab
cczixun1 天前
局域网协同办公软件,2024安全的协同办公软件推荐
经验分享·其他·政务
别下那么会看场合的雨啊1 天前
删除缓存之后,浏览器显示登录新设备
经验分享
志-AOX2 天前
现在转前端怎么样?
经验分享