gitlab

分享一下我们公司现在在用的一套微服务项目CI/CD流程(gitlab+rancher)

两盒软妹~` 提交于 2020-01-19 14:03:55
概述     这套流程仅供参考,我们公司现在用的很稳定,如若踩到坑,欢迎一起探讨! 组成 gitlab-ce gitlab-runner docker-registry rancher 流程     代码->gitlab-ce->gitlab-runner->docker-registry->rancher->服务器 分解 gitlab-ce     团队项目开发的代码管理工具,可以粗略的理解为私有版的github,功能要远强于SVN,支持很多插件,后面提到的gitlab-runner也是其一,缺点是有一定的学习成本,还有一点是对于运行的服务器有一定的要求,印象中是内存要大于4g。 gitlab-runner     要使用gitlab-ce中CI/CD功能的必备插件,主要功能是依据定制的yml脚本来触发代码的编译和发布流程。这一块涉及的东西比较多会另开一篇作详细介绍! docker-registry     上一步中代码发布阶段会根据Dockerfile将生成的publishcode放到一个dockerimage中,push到docker-registry中作中转用,docker-registry我们使用的是aliyun的容器镜像仓库,也可以使用dockerhub或者是harbor自建仓库等。 rancher     一个基于k8s的容器编排系统

git,github,gitlab和码云的区别

点点圈 提交于 2020-01-19 05:10:58
相关概念 1.git的概念 git 是一个 开源的分布式版本控制系统 ,用于 敏捷高效地处理任何或小或大的项目 。 git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件 。 git 与常用的版本控制工具 CVS, Subversion 等不同,它 采用了分布式版本库的方式,不必服务器端软件支持 。 git 由Linus Linus花了两周时间自己用C写了一个分布式版本控制系统,在2008 正式上线。(这里和Linux有一段黑历史)。 2.github的概念 github( https://github.com/ )是一个 面向开源及私有软件项目的托管平台 ,因为只支持git 作为唯一的版本库格式进行托管,故名GitHub。 github于2008年4月10日正式上线,除了Git代码仓库托管及基本的 Web管理界面以外,还提供了 订阅、讨论组、文本渲染、在线文件编辑器、协作图谱 (报表)、 代码片段分享 (Gist)等功能。目前,其注册用户已经超过350万,托管版本数量也是非常之多,其中不乏知名开源项目 Ruby on Rails 、 jQuery 、 python 等。 2018年6月4日,微软宣布,通过75亿美元的股票交易收购 代码托管平台GitHub 。 2019年05月,《个人电脑杂志》网站报道

在Centos7上安装Gitlab+Jenkins+Ansible番外篇-解决https SSL自签名证书无效问题在这里插入图片描述

橙三吉。 提交于 2020-01-19 00:25:06
番外篇-解决https SSL自签名证书无效问题 # 本机git窗口操作:将导出的证书from_gitlab.cer证书复制到/usr/local/jdk1.8.0_45/jre/lib/security目录下 scp C:/Users/helenlv/Desktop/DEVOPS/from_gitlab.cer root@10.20.217.17:/usr/local/jdk1.8.0_45/jre/lib/security [ root@gitlab ~ ] # cd /usr/local/jdk1.8.0_45/jre/lib/security/ [ root@gitlab security ] # keytool -import -alias from_gitlab -keystore cacerts -file from_gitlab.cer Enter keystore password: keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect [ root@gitlab security ] # keytool -import -alias from_gitlab -keystore cacerts -file from_gitlab.cer

云服务器CentOS7.4下搭建GitLab

醉酒当歌 提交于 2020-01-18 21:59:50
一、Git、GitHub、GitLab的区别 Git是版本控制系统,Github是在线的基于Git的代码托管服务。 GitHub是2008年由Ruby on Rails编写而成。GitHub同时提供付费账户和免费账户。这两种账户都可以创建公开的代码仓库,只有付费账户可以创建私有的代码仓库。 Gitlab解决了这个问题, 可以在上面创建免费的私人repo。 官方安装介绍: https://about.gitlab.com/install/ 说明一下,官网提供GitLab的两种版本:gitlab-ee版本(企业版)和gitlab-ce版本(社区版),社区版是免费的。 二、GitLab Server搭建 官方文档: https://docs.gitlab.com/ce/install/requirements.html#cpu ,安装GitLab的硬件需求,官方推荐至少4GB的空闲内存来运行GitLab。 我用的是2G内存的腾讯云服务器,自己添加了4G的swap,感觉勉强能用 (1)安装并配置必要的依赖关系 yum install -y curl openssh-server openssh-clients postfix cronie policycoreutils-python # 10.x以后开始依赖 policycoreutils-python,之前的版本不需要安装 # 启动

基于Jenkins+Gitlab+Docker实现SpringBoot项目自动部署、持续集成、持续交付(无废话版)---------------(三)

ぃ、小莉子 提交于 2020-01-18 13:11:30
基于Jenkins+Gitlab+Docker实现SpringBoot项目自动部署 1. 使用Docker搭建Jenkins 1.1 拉取Jenkins镜像 1.2 创建目录 1.3 启动容器 1.4 打开Jenkins管理页面 1.5 查看日志获取初始密码 1.6 安装推荐的插件 1.7 成功安装Jenkins 2. 配置Jenkins 2.1 设置Jenkins时区为北京时间 2.2 安装自动化构建和部署所需的插件 2.3 添加凭据 2.4 配置SSH remote hosts 2.5 全局工具配置 2.5.1 安装JDK 2.5.2 安装Git 2.5.3 安装Maven 2.5.4 安装Docker 2.6 全局安全配置 2.7 关于webhook 3. 新建Jenkins任务 3.1 点击新建任务,输入名称【本处输入名称注意】 3.2 源码管理 3.3 构建触发器 3.4 添加webhook 3.5 构建环境 3.6 Pre Steps(构建之前的步骤) 3.7 Build(构建) 3.8 Post Steps(执行任务) 3.9 测试 4. 参考资料 1. 使用Docker搭建Jenkins 1.1 拉取Jenkins镜像 进入官网: https://jenkins.io/download/ 点击 Docker 进入Docker Hub 我们这里选择jenkins

gitlib忘记管理员密码,强制更改

那年仲夏 提交于 2020-01-17 12:03:01
1.进入gitlab控制台 输入gitlab-rails console production进入gitlab控制台 2.查询gitlab超级管理员信息 输入user = User.where(id:1).first查询id为1的用户对象,因为超级管理员用户默认都是1,也可以更加username来查询用户对象,管理员账户对象查询到之后,可以从返回的信息中看到admin为true,username为root 3.重置密码 输入user.password=‘密码’,密码位置填写您新的密码即可。然后再输入user.save!保存用户对象 4.返回gitlab登录界面重新登录 来源: CSDN 作者: MisTTT 链接: https://blog.csdn.net/MisTTT/article/details/104014776

centos7安装部署gitlab服务器

百般思念 提交于 2020-01-16 23:25:05
我这里使用的是centos 7 64bit系统,我试过centos 64bit系统也是可以的。 1. 安装依赖软件 yum -y install policycoreutils openssh-server openssh-clients postfix 2.设置postfix开机自启,并启动,postfix支持gitlab发信功能 systemctl enable postfix && systemctl start postfix 3.下载gitlab安装包,然后安装 centos 6系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6 centos 7系统的下载地址:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 我的是centos7,所以我在https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7中找了个gitlab8.0.0版本,建议下载一个比较新的版本,我这里选了一个比较旧的版本仅仅是实验记录。 下载rpm包并安装: wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7

How to use gitlab-shell to “add custom git hooks to any GitLab project”

六眼飞鱼酱① 提交于 2020-01-16 20:09:47
问题 I'm trying to setup custom git hooks with gitlab similar to the user in this question. Specifically a pre-receive hook - therefore web hooks and CI will not suffice. Most search results show how to perform this action when admin access to the gitlab host file system is available. This mirrors the documentation: Custom Git hooks must be configured on the filesystem of the GitLab server. Only GitLab server administrators will be able to complete these tasks. However, the following is later

I have an error when i initialize gradle on my CI

旧时模样 提交于 2020-01-16 19:22:06
问题 I made an CI with Gitlab for a Flutter application and I have an error when i initialize gradle. The error: $ flutter packages get Running "flutter packages get" in codingroomevents... 8.5s $ flutter build apk --release Initializing gradle... ProcessException: Process "/builds/user/codingroomevents/android/gradlew" exited abnormally: Downloading https://services.gradle.org/distributions/gradle-4.10.2-all.zip Exception in thread "main" java.net.SocketException: Network is unreachable (connect

gitlab-ci.yml deployment on multiple hosts

扶醉桌前 提交于 2020-01-16 13:10:08
问题 I need to deploy my application on multiple servers. I have hosted my source code on gitlab-ci. I have setup envrionnement variables and .gitlab-ci.yml file It works great for a single server: I can build docker images and push this images to a registry. Then i am deploying this images on a kubernetes infrastructure. All operations are described in .gitlab-ci.yml What i need to do is to "repeat" .gitlab-ci.yml steps for each server. I need a different set of envrionment variables for each