zoukankan      html  css  js  c++  java
  • Linux在线或者离线安装gitlab

    参考博客:RHEL7/CentOS7 在线和离线安装 GitLab 配置使用实践

    在线安装gitlab

    • 依赖安装
    yum install curl policycoreutils openssh-server openssh-clients -y
    systemctl enable sshd
    systemctl start sshd
    yum install postfix
    systemctl enable postfix
    
    # 检查修改邮件下面 2 项配置,不配置可以跳过
    vim /etc/postfix/main.cf 
    
    inet_interfaces = all
    inet_protocols = ipv4
    
    systemctl start postfix
    
    • 在线安装 gitlab-ce
    # 安装必要的依赖包,如果不需要可以考虑跳过
    yum install pygpgme yum-utils
    # On CentOS 7 (and RedHat/Oracle/Scientific Linux 7), the commands below will also open HTTP and SSH access in the system firewall.
    sudo yum install -y curl policycoreutils-python openssh-server
    sudo systemctl enable sshd
    sudo systemctl start sshd
    sudo firewall-cmd --permanent --add-service=http
    sudo systemctl reload firewalld
    # Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.
    sudo yum install postfix
    sudo systemctl enable postfix
    sudo systemctl start postfix
    
    # 使用阿里云作加速
    cd /etc/yum.repos.d/ && rm -f *.repo
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    
    # 添加 GitLab 镜像源并安装,建议切换国内资源加速访问
    curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
    
    # 创建 gitlab-ce 的 repo,使用清华大学加速
    vim /etc/yum.repos.d/gitlab_gitlab-ce.repo
    
    [gitlab-ce]
    name=gitlab-ce
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
    repo_gpgcheck=0
    gpgcheck=0
    enabled=1
    gpgkey=https://packages.gitlab.com/gpg.key
    
    # 配置并启动 GitLab
    gitlab-ctl reconfigure
    

    离线安装gitlab

    # 使用阿里云作加速
    cd /etc/yum.repos.d/ && rm -f *.repo
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    
    # 添加 GitLab 镜像源并安装,建议切换国内资源加速访问
    curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
    
    # 创建 gitlab-ce 的 repo,使用清华大学加速
    vim /etc/yum.repos.d/gitlab_gitlab-ce.repo
    
    [gitlab-ce]
    name=gitlab-ce
    baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
    repo_gpgcheck=0
    gpgcheck=0
    enabled=1
    gpgkey=https://packages.gitlab.com/gpg.key
    
    # 安装 yum-plugin-downloadonly 插件
    yum install -y yum-plugin-downloadonly
    
    # 下载 gitlab-ce 相关 rpm 到指定目录
    mkdir -p /tmp/repo/gitlab-ce/
    yum install --downloadonly --downloaddir=/tmp/repo/gitlab-ce/ gitlab-ce
    
    # 拷贝文件至内网离线安装
    rpm -ivh /tmp/repo/gitlab-ce/*
    
    # 配置并启动 GitLab
    gitlab-ctl reconfigure
    
    # 第一次访问 GitLab,系统会重定向页面到重定向到重置密码页面,你需要输入初始化管理员账号的密码,管理员的用户名为 root,重置密码后新密码即为刚输入的密码。
    0.0.0.0:80
    
  • 相关阅读:
    静态邻接表dijkstra
    最短路径系列【最短路径、哈密顿路等】
    python 给多人发送邮件,且将结果添加为附件
    Excel调换数据位置
    try ... except...,好处是执行失败后,仍然可以继续运行
    制作表头,2种方式
    工资表变工资条,2种方式
    C言语教程第一章: C言语概论 (4)
    从红旗5.0说起——看Linux的内存解决
    红旗Linux桌面4.1文本安装历程图解(二)
  • 原文地址:https://www.cnblogs.com/mrnx2004/p/11725535.html
Copyright © 2011-2022 走看看