wordpress小说下载站,免费域名备案,网页版qq登录入口空间,电商网站建设应用本文作者#xff1a;徐晓伟 GitLab 是一个全球知名的一体化 DevOps 平台#xff0c;很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab 是 GitLab 在中国的发行版#xff0c;专门为中国程序员服务。可以一键式部署极狐GitLab。
在极狐GitLab Runner Job 添加域名… 本文作者徐晓伟 GitLab 是一个全球知名的一体化 DevOps 平台很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLab 是 GitLab 在中国的发行版专门为中国程序员服务。可以一键式部署极狐GitLab。
在极狐GitLab Runner Job 添加域名 host是为了检出代码时使用。
问题 测试项目公开地址https://framagit.org/xuxiaowei-com-cn/sleep 分支host 流水线配置 stages:- buildbuild-job:stage: buildvariables:# 环境变量SLEEP_TIME: 600script:# 延时一段时间从环境变量中获取- sleep $SLEEP_TIME流水线执行日志如下 问题原因未解析 gitlab.test.helm.xuxiaowei.cn 域名
解决办法 导出 helm gitlab 配置 # 将已配置的值导出到文件中
helm -n gitlab-test get values my-gitlab my-gitlab.yaml查看 gitlab runner 默认配置 # 此处为节选不同版本可能会存在差异请以 https://artifacthub.io/packages/helm/gitlab/gitlab?modalvalues 中的配置为准
gitlab-runner:runners:config: |[[runners]][runners.kubernetes]image ubuntu:22.04{{- if .Values.global.minio.enabled }}[runners.cache]Type s3Path gitlab-runnerShared true[runners.cache.s3]ServerAddress {{ include gitlab-runner.cache-tpl.s3ServerAddress . }}BucketName runner-cacheBucketLocation us-east-1Insecure false{{ end }}修改配置如下 gitlab-runner:runners:config: |[[runners]][runners.kubernetes]image ubuntu:22.04[[runners.kubernetes.host_aliases]]ip 172.25.25.32hostnames [ gitlab.test.helm.xuxiaowei.cn ]{{- if .Values.global.minio.enabled }}[runners.cache]Type s3Path gitlab-runnerShared true[runners.cache.s3]ServerAddress {{ include gitlab-runner.cache-tpl.s3ServerAddress . }}BucketName runner-cacheBucketLocation us-east-1Insecure false{{ end }}更新配置 helm upgrade -n gitlab-test --install my-gitlab gitlab/gitlab --timeout 600s -f my-gitlab.yaml --version 7.7.0等待所有 gitlab-runner 旧 pod 删除完成新 pod 正常运行时重试流水线即可正常检出代码 说明 检出代码与当前 .gitlab-ci.yml 使用的什么镜像无关比如说在 .gitlab-ci.yml 中使用的镜像中无 git也可以正常运行 而是使用的 helper 镜像创建的容器此容器还负责上传/下载缓存等操作
更多关于极狐GitLab 的最佳实践请搜索关注【极狐GitLab】公众号或者登录极狐GitLab 官网 https://gitlab.cn 进行学习。