Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use GitLab to manage remote warehouses

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "how to use GitLab to manage remote warehouse", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use GitLab to manage remote warehouse" article.

GitLab is an open source project for warehouse management system, which uses Git as a code management tool and builds Web services on this basis.

Installation

You can also download the rpm package and install it directly. The installation method is as follows:

Yum install-y postfixyum install-y cronieservice postfix startchkconfig postfix onlokkit-s http-s sshcurl-O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.9.4_omnibus.1-1.el6.x86_64.rpmrpm-vih gitlab-7.9.4_omnibus.1-1.el6.x86_64.rpmgitlab-ctl reconfigure

After the installation is completed, enter the IP address of gitlab in the browser to access it. The default account password is: rootbank 5iveLSecretfe.

Gitlab basic configuration # cat / etc/gitlab/gitlab.rbexternal_url 'http://git.hongxin.com' # specify gitlab server address nginx [' enable'] = false # do not enable nginx#nginx included with gitlab ['listen_addresses'] = [' 192.168.1.202'] # gitlab snooping address unicorn ['port'] = 8080 # modify the default port of unicorn, that is, the default port of gitlab service. You can enable this port, turn off the nginx that comes with gitlab, and use other nginx to proxy the port gitlab_rails ['gitlab_shell_ssh_port'] = 52113 # to define the ssh port configuration, which needs to be consistent with the port that ssh listens on in / etc/ssh/sshd_config file.

All the project directories of gitlab are under / var/opt/gitlab and the data warehouse is stored under / var/opt/gitlab/git-data/.

After the configuration is complete, execute gitlab-ctl reconfigure to load the configuration and start gitlab

Gitlab's mail configuration uses the local postfix to send mail service potfix startvim / etc/gitlab/gitlab.rbgitlab_rails ['gitlab_email_from'] =' gitlab@example.com' # to define the name of the mailbox to send mail Default use native postfix to send mail using mail sending template gitlab_rails ['smtp_enable'] = truegitlab_rails [' smtp_address'] = "smtp.exmail.qq.com" gitlab_rails ['smtp_port'] = 465gitlab_rails [' smtp_user_name'] = "full mail account" gitlab_rails ['smtp_password'] = "password" gitlab_rails [' smtp_domain'] = "domain of mail account" gitlab_ Rails ['smtp_authentication'] = "login" gitlab_rails [' smtp_enable_starttls_auto'] = truegitlab_rails ['smtp_tls'] = true # this is very important And it is the sender of # modifying gitlab configuration, which is not mentioned in the official document. Otherwise, the error of "553 Mail from must equal authorized user" will be thrown gitlab_rails ['gitlab_email_from'] =' full email account 'user ["git_user_email"] = "xxxxxxx" using Tencent enterprise mailbox configuration to send email gitlab_rails [' smtp_enable'] = truegitlab_rails ['smtp_address'] = "smtp.exmail.qq.com" gitlab_rails [' smtp_port'] = 465gitlab_rails ['smtp_user_name'] = "tech@gongmall.com" gitlab_rails ['smtp_password'] = "tech@gongmall.com password" gitlab_rails [' smtp_domain'] = "gongmall.com" gitlab_rails ['smtp_authentication'] = "login" gitlab_rails [' smtp_enable_starttls_auto'] = truegitlab_rails ['smtp_tls'] = truegitlab_rails [' gitlab_email_from'] = 'tech@gongmall.com'user ["git_user_email"] = "xxxxxxx" to make # cat / etc/gitlab/gitlab.rb# configure smtpgitlab_rails ['smtp_enable'] = truegitlab_rails [' smtp_address'] = "smtp.163.com" gitlab_rails ['smtp_port'] = 2" configure mailbox account password gitlab_rails [' smtp_user_name'] = "yan_ruo_gu@163.com" gitlab_rails ['smtp_password'] = "xxxxxxx" # configure mailbox domain gitlab_ Rails ['smtp_domain'] =' 163.com'gitlab_rails ['smtp_authentication'] =: login # is configured as follows: plaingitlab_rails [' smtp_enable_starttls_auto'] = true # whether tls authentication is enabled # the sender who modifies the gitlab configuration Otherwise, the error of "553 Mail from must equal authorized user" gitlab_rails ['gitlab_email_from'] = "yan_ruo_gu@163.com" user ["git_user_email"] = "xxxxxxx" enables gitlab's https

# generate key pair

Cd / etc/gitlab/sslopenssl genrsa-des3-out server.key 1024openssl rsa-in server.key-out server.key # remove server.key 's encrypted password openssl req-new-key server.key-out server.csropenssl x509-req-days 365-in server.csr-signkey server.key-out server.crt# vim / etc/gitlab/gitlab.rbnginx ['redirect_http_to_https'] = truenginx [' ssl_certificate'] = "/ etc/gitlab/ssl/server.crt" nginx [ 'ssl_certificate_key'] = "/ etc/gitlab/ssl/server.key" gitlab-ctl reconfigure changes the warehouse storage path

The default warehouse path for gitlab is / var/opt/gitlab/git-data/repositories. Generally, there is not enough space for / var on the server, so configure the warehouse to another path.

The new warehouse modifies the storage path

If you have just installed gitlab and haven't started using it, you can modify the configuration:

# vim / etc/gitlab/gitlab.rbgit_data_dir "/ data/git-data" used the warehouse for some time to modify the storage path

If gitlab is already in use, in addition to modifying the configuration, the following steps are required:

Gitlab-ctl stoprsync-av / var/opt/gitlab/git-data/repositories / data/git-data/# vim / etc/gitlab/gitlab.rbgit_data_dir "/ data/git-data" gitlab-ctl startgitlab-ctl reconfiguregitlab data backup and recovery

Backup

Scheduled tasks for gitlab backups:

0 2 * / opt/gitlab/bin/gitlab-rake gitlab:backup:create

Gitlab modifies the backup path:

# vim / etc/gitlab/gitlab.rbgitlab_rails ['backup_path'] =' / mnt/backups'

Restore

Stop the related data connection service:

Gitlab-ctl stop unicorngitlab-ctl stop sidekiq

Restore from the specified number backup:

Gitlab-rake gitlab:backup:restore BACKUP=139351368

Start gitlab:

Gitlab-ctl start migration

Copy the backup file to the backup directory of gitlab and perform the restore operation

Gitlab avatar cannot be displayed properly.

Add the following items to the configuration file / etc/gitlab/gitlab.rb:

Gitlab_rails ['gravatar_plain_url'] =' http://gravatar.duoshuo.com/avatar/%{hash}?s=%{size}&d=identicon'

Then execute:

Gitlab-ctl reconfiguregitlab-rake cache:clear RAILS_ENV=productiongitlab check log gitlab-ctl tail above is about "how to use GitLab to manage remote warehouse" this article content, I believe we all have a certain understanding, I hope the editor to share the content to help you, if you want to know more related knowledge content, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report