實際應用
設置之前要在個人用戶設置中增加key(為了備份ssh的項目)
備份
進入ditlab容器
cd /home/git/gitlab
bundle exec rake gitlab:backup:create RAILS_ENV=production
cd /home/git/gitlab
bundle exec bin/rake gitlab:backup:restore RAILS_ENV=production
chown git:git -R /opt/gitlab-7.11.4-0/apps/gitlab/repositories
以上為自我時間內容,以下為轉載其他人內容
gitlab的安裝以及備份恢復 2015-08-07 15:22:03
分類: 項目管理
下載安裝包wget https://downloads.bitnami.com/files/stacks/gitlab/7.11.4-0/bitnami-gitlab-7.11.4-0-linux-x64-installer.run
然后更改成執行權限:chmod a+x bitnami-gitlab-7.11.4-0-linux-x64-installer.run
再執行安裝:./bitnami-gitlab-7.11.4-0-linux-x64-installer.run
按照提示安裝輸入Y/N安裝:
點擊(此處)折疊或打開
- [root@wb-2 ~]# ./bitnami-gitlab-7.11.4-0-linux-x64-installer.run
- The installer detects that exists a 'git' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y
- The installer detects that exists a 'gitlab_ci' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y
- ----------------------------------------------------------------------------
- Welcome to the Bitnami Gitlab Stack Setup Wizard.
- ----------------------------------------------------------------------------
- Select the components you want to install; clear the components you do not want
- to install. Click Next when you are ready to continue.
- PhpPgAdmin [Y/n] :Y
- GitLab : Y (Cannot be edited)
- GitLab CI [Y/n] :Y
- Is the selection above correct? [Y/n]: Y
- ----------------------------------------------------------------------------
- Installation folder
- Please, choose a folder to install Bitnami Gitlab Stack
- Select a folder [/opt/gitlab-7.11.4-0]: /opt/bitnami
- ----------------------------------------------------------------------------
- Create Admin account
- Bitnami Gitlab Stack admin user creation
- Email Address [user@example.com]: test@gmail.com
- Login [user]: test
- Password :
- Please confirm your password :
- ----------------------------------------------------------------------------
- Hostname that will be used to create internal URLs. If this value is incorrect,
- you may be unable to access your Gitlab installation from other computers. It is
- advisable to use a Domain instead of an IP address for compatibility with
- different browsers.
- Domain [127.0.0.1]: test.gitlab.com
- Do you want to configure mail support? [y/N]: N
- ----------------------------------------------------------------------------
- Setup is now ready to begin installing Bitnami Gitlab Stack on your computer.
- Do you want to continue? [Y/n]: Y
- ----------------------------------------------------------------------------
- Please wait while Setup installs Bitnami Gitlab Stack on your computer.
- Installing
- 0% ______________ 50% ______________ 100%
- #########################################
- ----------------------------------------------------------------------------
- Setup has finished installing Bitnami Gitlab Stack on your computer.
- Info: To access the Bitnami Gitlab Stack, go to
- http://dev.domain.org:80 from your browser.
- Press [Enter] to continue:
到此,整個安裝結束,設置好HOST后訪問test.gitlab.com就可以正常使用了。
備份以及恢復的操作,以下操作使用root用戶執行:
1、指定備份路徑vi /opt/gitlab-6.4.3-1/apps/gitlab/htdocs/config/gitlab.yml,找到如下所示修改
點擊(此處)折疊或打開
- ## Backup settings
- backup:
- path: "/tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
2、執行備份
點擊(此處)折疊或打開
- cd /opt/gitlab-7.11.4-0/
- ./use_gitlab
- cd /opt/gitlab-7.11.4-0/apps/gitlab/htdocs
- bundle exec bin/rake gitlab:backup:create RAILS_ENV=production
3、恢復備份的數據
點擊(此處)折疊或打開
- cd /opt/gitlab-7.11.4-0/
- ./use_gitlab
- cd /opt/gitlab-7.11.4-0/apps/gitlab/htdocs
- bundle exec bin/rake gitlab:backup:restore RAILS_ENV=production
- chown git:git -R /opt/gitlab-7.11.4-0/apps/gitlab/repositories
至此備份恢復完畢。
