zoukankan      html  css  js  c++  java
  • git gitlab


    gitlab的安装与部署
    部署环境   centos7.5
    一. 安装依赖
    [root@localhost ~]# systemctl stop/disable/mask firewalld     #中间三个参数都执行一遍
    [root@localhost ~]# yum install curl openssh-server openssh-clients postfix cronie
    [root@localhost ~]# yum -y install policycoreutils-python iptables iptables-services
    [root@localhost ~]# systemctl start postfix #GitLab使用postfix发送邮件
    Starting postfix: [ OK ]
    [root@localhost ~]# systemclt enable postfix #设置postfix开机自启动
    [root@localhost ~]# lokkit -s http -s ssh #配置iptables开放http和ssh端口,这里需要注意,腾讯云安全组选择那里要选择开放所有端口这一步可能会显示failed ip6tables start,这个不需要管,直接运行下面查看是否打开端口就可以了
    [root@localhost ~]# iptables -L #输入命令查看是否打开http和ssh端口
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
    ACCEPT icmp -- anywhere anywhere
    ACCEPT all -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere state NEWtcp dpt:ssh
    ACCEPT tcp -- anywhere anywhere state NEWtcp dpt:http #如显示上面的界面则表示已经打开端口

    二.安装gitlab
    rpm包下载地址  https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/
    [root@bogon ~]# rpm -ivh gitlab-ce-10.0.0-ce.0.el7.x86_64.rpm
    [root@localhost ~]# vim /etc/gitlab/gitlab.rb
    external_url 'http://192.168.157.36' #将外部URL这行修改为gitlab服务器的IP地址
    [root@bogon ~]# cat -n /etc/gitlab/gitlab.rb |grep -w "13"
        13 external_url 'http://192.168.157.36'
    [root@localhost ~]# gitlab-ctl reconfigure #配置gitlab,时间稍微有点长,大概1分钟,这步也是启动gitla

    • gitlab的默认监听端口是8080,jenkins的监听端口也是8080

    三.登陆gitlab

    • 在浏览器输入gitlab主机IP地址即可访问GIT,第一次登陆的时候,需要初始化大量的东西,经常会出现502错误,通常是由于内存不足的原因导致,官方推荐生产环境中使用2G内存,2核CUP。虚拟机中测试1GB内存基本就可以了。
    • 首次登陆默认进入修改密码页面,而且至少8位,这里我将密码修改为0000

     跳转到注册和登陆页面我们先注册一下  , 我注册的name : rebareba   password: zixi.519

    四.gitlab的简单使用

    1.创建一个gitlab项目
    创建组

    lllljllk

    dd

    • 创建完成,但此处还没做ssh

    五.在windows上安装git客户端
    下载地址  https://git-scm.com/downloads  #这是官网非常慢此处我就用别人给我提供的低版本包了










     
    2 安装TortoiseGit
    由于git自带Git GUI图形客户端不太好用,而且用Git Bash需要熟练git的操作命令,所以
    选择TortoiseGit做图形客户端
    获取TortoiseGit 和中文支持包

    安装TortoiseGit
    一路next


















































  • 相关阅读:
    git stash回退
    基于git tag快速修复
    Go语言开发规范
    defer实现原理
    string数据结构
    关于const iota
    struct
    map数据结构底层详解
    go 函数进阶
    go 内存分配原理
  • 原文地址:https://www.cnblogs.com/panqingpeng/p/9380795.html
Copyright © 2011-2022 走看看