gitlab
一、.gitlab安装
清华源地址 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
1.下载安装包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.9.1-ce.0.el7.x86_64.rpm --no-check-certificate
2.安装
rpm -ivh gitlab-ce-15.9.1-ce.0.el7.x86_64.rpm
3.修改配置
external_url 'http://172.17.11.235:28080'
gitlab_rails['time_zone'] = 'Asia/Shanghai'
puma['worker_processes'] = 2
sidekiq['max_concurrency'] = 8
postgresql['shared_buffers'] = "128MB" #缓存
postgresql['max_worker_processes'] = 4
prometheus_monitoring['enable'] = false
4.更新配置并重启
gitlab-ctl reconfigure
gitlab-ctl restart
#查看初始化密码:
cat /etc/gitlab/initial_root_password
#浏览器访问
http://172.17.11.235:28080/users/sign_in
[root@master scripts]# cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
# 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
# 2. Password hasn't been changed manually, either via UI or via command line.
#
# If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
Password: UlIZfAZ4BezPDMgQVGO4mlgB7n0qybS5Y/qsBJP+Yf4=
# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
二、页面配置
#修改系统配置:
左上角三横 >> admin
头像关闭:
关闭用户注册功能:
开启webhook外部访问:
Settings >> network >> Outbound requests >> Allow requests to the local
network from web hooks and services 勾选
设置语言为中文(全局)
Settings >> Preferences >> Localization >> Default language >> 选择简体中文 >> save changes
设置当前用户语言为中文
三、配置secret
四、为项目配置webhook
五、卸载
harbor
一、安装
私有镜像仓库harbor搭建链接:私有镜像仓库harbor搭建
二、配置secret
SonarQube
基础静态代码规范检查
sonarqube 是一个代码质量管理平台
可通过安装不同的插件集成测试工具、代码质量分析工具、持续集成等多种功能。
sonarqube 目前最新版为 8.0,最新稳定版本为 7.9,由于性能原因,sonar 从 7.9 之后就不再 支持 MySQL,替代方案为 PostgreSQL。
这里选择 postgres:12 和 sonarqube:7.9-community 两个 docker 镜像,使用 docker-compose 配置并启动
一、安装
二、创建webhook服务
三、创建项目
jenkins
安装插件
Build Authorization Token Root # 自动生成token
GitLab #gitlab插件
SonarQube ScannerVersion #代码扫描
Node and Label parameterVersion #配置节点标签 The node and label parameter plugin allows the node for a job to be selected dynamically.
Kubernetes #K8S插件
Config File Provider
Git Parameter
安装完插件后进行相关配置