版本控制gitlab

来源:https://www.cnblogs.com/Their-own/archive/2022/09/22/16721275.html
-Advertisement-
Play Games

版本控制gitlab 什麼是版本控制gitlab GitLab 是一個用於倉庫管理系統的開源項目,使用Git作為代碼管理工具,併在此基礎上搭建起來的Web服務。安裝方法是參考GitLab在GitHub上的Wiki頁面。Gitlab是目前被廣泛使用的基於git的開源代碼管理平臺, 基於Ruby on ...


版本控制gitlab

目錄

什麼是版本控制gitlab

GitLab 是一個用於倉庫管理系統的開源項目,使用Git作為代碼管理工具,併在此基礎上搭建起來的Web服務。安裝方法是參考GitLab在GitHub上的Wiki頁面。Gitlab是目前被廣泛使用的基於git的開源代碼管理平臺, 基於Ruby on Rails構建, 主要針對軟體開發過程中產生的代碼和文檔進行管理, Gitlab主要針對group和project兩個維度進行代碼和文檔管理, 其中group是群組, project是工程項目, 一個group可以管理多個project, 可以理解為一個群組中有多項軟體開發任務, 而一個project中可能包含多個branch, 意為每個項目中有多個分支, 分支間相互獨立, 不同分支可以進行歸併。

常用的版本控制工具:

  • gitlab
  • subversion

gitlab部署

部署需要至少4GB記憶體運行,如果不夠儘量調製最高,方便後面編譯

阿裡雲鏡像源

#配置yum源
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# rm -rf *
[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
[root@localhost yum.repos.d]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@localhost yum.repos.d]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
[root@localhost yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
[root@localhost yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

#關閉防火牆和selinux
[root@localhost ~]# setenforce 0
[root@localhost ~]# vim /etc/selinux/config 
SELINUX=disabled
[root@localhost ~]# systemctl disable --now firewalld

下載gitlab的包

下載policycoreutils-python依賴包

下載地址image

image

清華大學開源軟體鏡像站

下載gitlab-ce包

image

#卸載依賴包
[root@localhost ~]# dnf -y remove policycoreutils

#下載包
[root@localhost ~]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/policycoreutils-python-2.5-34.el7.x86_64.rpm
[root@localhost ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm
[root@localhost ~]# ls
anaconda-ks.cfg  gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm  policycoreutils-python-2.5-34.el7.x86_64.rpm

[root@localhost ~]# yum -y install epel-release git
[root@localhost ~]# yum -y install curl openssh-server openssh-clients postfix cronie perl
#安裝policycoreutils-python
[root@localhost ~]# rpm -ivh --nodeps policycoreutils-python-2.5-34.el7.x86_64.rpm 
warning: policycoreutils-python-2.5-34.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:policycoreutils-python-2.5-34.el7################################# [100%]

#安裝gitlab-ce
[root@localhost ~]# rpm -ivh gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm 
warning: gitlab-ce-15.3.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:gitlab-ce-15.3.3-ce.0.el7        ################################# [100%]
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=15-3

#啟動postfix服務
[root@localhost ~]# systemctl enable --now postfix

#修改配置文件
[root@localhost ~]# vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.111.139'		//修改為主機IP

#重新配置需要等待一段時間
[root@localhost ~]# export LANG=en_US.UTF-8
[root@localhost ~]# bash
[root@localhost ~]# gitlab-ctl reconfigure
[root@localhost ~]# ss -anlt
State            Recv-Q           Send-Q                       Local Address:Port                       Peer Address:Port           Process           
LISTEN           0                1024                             127.0.0.1:9100                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:9229                            0.0.0.0:*                                
LISTEN           0                128                              127.0.0.1:9168                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:8080                            0.0.0.0:*                                
LISTEN           0                511                                0.0.0.0:80                              0.0.0.0:*                                
LISTEN           0                128                              127.0.0.1:8082                            0.0.0.0:*                                
LISTEN           0                128                              127.0.0.1:9236                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:8150                            0.0.0.0:*                                
LISTEN           0                128                                0.0.0.0:22                              0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:8151                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:8153                            0.0.0.0:*                                
LISTEN           0                100                              127.0.0.1:25                              0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:8154                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:8155                            0.0.0.0:*                                
LISTEN           0                128                              127.0.0.1:8092                            0.0.0.0:*                                
LISTEN           0                511                                0.0.0.0:8060                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:9121                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:9090                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:9187                            0.0.0.0:*                                
LISTEN           0                1024                             127.0.0.1:9093                            0.0.0.0:*                                
LISTEN           0                128                                  [::1]:9168                               [::]:*                                
LISTEN           0                128                                   [::]:22                                 [::]:*                                
LISTEN           0                100                                  [::1]:25                                 [::]:*                                
LISTEN           0                1024                                     *:9094                                  *:*                                

[root@localhost ~]# gitlab-ctl restart
ok: run: alertmanager: (pid 53289) 0s
ok: run: gitaly: (pid 53373) 1s
ok: run: gitlab-exporter: (pid 53415) 0s
ok: run: gitlab-kas: (pid 53417) 1s
ok: run: gitlab-workhorse: (pid 53451) 0s
ok: run: logrotate: (pid 53463) 0s
ok: run: nginx: (pid 53469) 1s
ok: run: node-exporter: (pid 53552) 0s
ok: run: postgres-exporter: (pid 53561) 1s
ok: run: postgresql: (pid 53596) 0s
ok: run: prometheus: (pid 53611) 1s
ok: run: puma: (pid 53647) 0s
ok: run: redis: (pid 53728) 0s
ok: run: redis-exporter: (pid 53734) 1s
ok: run: sidekiq: (pid 53959) 0s

#查看當前的gitlab版本
[root@localhost ~]# head -1 /opt/gitlab/version-manifest.txt
gitlab-ce 15.3.3

#破解管理員密碼
[root@localhost ~]# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       15.3.3 (c629a47f87f) FOSS
 GitLab Shell: 14.10.0
 PostgreSQL:   13.6
------------------------------------------------------------[ booted in 19.84s ]
Loading production environment (Rails 6.1.6.1)
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
irb(main):002:0> user.password = '12345678'
=> "12345678"
irb(main):003:0> user.password_confirmation = '12345678'
=> "12345678"
irb(main):004:0> user.save!
=> true
irb(main):005:0> exit

訪問網頁

image

image


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 零基礎 OpenGL ES 學習路線推薦 : OpenGL ES 學習目錄 >> OpenGL ES 基礎 零基礎 OpenGL ES 學習路線推薦 : OpenGL ES 學習目錄 >> OpenGL ES 特效 零基礎 OpenGL ES 學習路線推薦 : OpenGL ES 學習目錄 >> O ...
  • “為什麼加索引能提升查詢效率”! 我們都認為“加索引”提升查詢效率是理所應當的 竟然還有理由? 該怎麼回答呢? 大家好,我是Mic,一個工作了14年的Java程式員 下麵分析一下這個問題的考察點 考察目標 這是一道原理性的問題,考察求職者對於Mysql中索引的實現原理的理解程度。 一般情況下,考察3 ...
  • 摘要:java中一切都是對象,為什麼int不用創建對象實例化,而可以直接使用? 本文分享自華為雲社區《【Java】對基本類型-整型數據結構的認識》,作者: huahua.Dr 。 整型數據類型有兩個:基本類型和引用類型(包裝類) 整數型基本類型:byte,int,short,long 其引用類型:B ...
  • 一、插入排序 1、直接插入排序 基本思想:類似抓撲克牌,待排序元素在已排序的序列中從後往前遍歷,遇到小於他的元素向後移一位,直至遇到小於或等於他的元素,在其後插入即可 2、希爾排序(是對直接插入排序的一種改進) 二、交換排序 1、冒泡排序 基本思想:相鄰的兩個元素進行兩兩比較,如果出現逆序,則小的元 ...
  • 前言 本次案例最終實現效果 開發環境 python 3.8: 解釋器 pycharm: 代碼編輯器 界面代碼實現 先導入所需模塊 import tkinter as tk from tkinter import ttk import tkinter.messagebox 創建視窗 root = tk ...
  • 一:背景 1. 講故事 其實這個問題是前段時間有位朋友咨詢我的,由於問題說的比較泛,不便作答,但想想梳理一下還是能回答一些的,這篇就來聊一聊下麵這幾個鎖。 Interlocked AutoResetEvent / ManualResetEvent Semaphore 用戶態層面我就不想說了,網上一搜 ...
  • .NET運行時之書(Book of the Runtime,簡稱BotR)是一系列描述.NET運行時的文檔,2007年左右在微軟內部創建,最初的目的為了幫助其新員工快速上手.NET運行時;隨著.NET開源,BotR也被公開了出來,如果你想深入理解CLR,這系列文章你不可錯過。 BotR系列目錄: [ ...
  • 從頭一二去閱讀語法和命令說明,對於腳本小白來說比較枯燥,難以堅持,所以這裡選擇對一份完整的shell腳本代碼來逐行逐段解讀,希望可以一渡小白,幫助我們快速進入腳本的大門^_^ ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...