@mrz1
2018-05-08T06:47:35.000000Z
字数 2032
阅读 892
持续集成
部署haproxy与tomeat环境
配置Jenkins使用gitib更新代码。
Jenkins 是一款流行的开源持续集成(Continuous Integration)工具,广泛用于项目开发,具有自动化构建、测试和部署等功能。本文以 CentOS7 环境为例,
什么是持续集成?
持续集成是指开发者在代码的开发过程中,可以频繁的将代码部署到集成到主干,并进程自动化测试。
什么是持续交付?
持续交付是指在持续集成的环境基础之上,将代码部署到预生产环境。
什么是持续部署?
在持续交付的基础之上,把部署到生产环境的过程自动化,持续部署 和交付的区别就是最终部署到生产环境是自动化的。
GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务,它集成了Github的可视化功能,方便开发人员协同工作.
GitLab是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。
GitLab拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
最小化服务器安装,配置如下:
# yum install vim gcc gcc-c++ wget net-tools Irzsz iotop lsof iotop bash-completion -y
# yum install curl policycoreutils openssh-server openssh-clients postfix -y
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# systemctl disable firewalld
# sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
# iptables -F
# hostnamectl set-hostname chuyuni.cn && exec bash
# yum update -y && reboot
三台服务器 jenkins-server
gitlib-server
``
[root@gitlib-server ~]# ls
jdk-8u111-linux-x64.rpm jenkins-2.27-1.1.noarch.rpm
[root@gitlib-server ~]#yum install *.rpm
[root@gitlib-server ~]#ls
gitlab-ce-8.13.5-ce.0.el7.x86_64.rpm jdk-8u111-linux-x64.rpm
[root@gitlib-server ~]#rpm -ivh gitlab-ce-8.13.5-ce.0.el7.x86_64.rpm
[root@gitlib-server ~]#vim /etc/gitlab/gitlab.rb
external_url 'https://192.168.42.72' #服务器IP地址 有域名可以写域名
# 邮箱测试
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "rooroot@163.com"
gitlab_rails['smtp_password'] = "zhang@123"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['gitlab_email_from'] = 'rooroot@163.com'
user['git_user_email'] = "rooroot@163.com"
[root@gitlib-server ~]#gitlab-ctl --help #查看命令帮助
[root@gitlib-server ~]#gitlab-ctl reconfigure #重新加载上面配置