首页 > 其他分享 >安装和restore gitlab 12.0.2

安装和restore gitlab 12.0.2

时间:2023-02-21 12:23:00浏览次数:91  
标签:02 restore 21 03 -- gitlab 12.0 done

下载和安装gitlab

  1. docker hub下载指定版本的itlab ce镜像

  2. 创建GITLAB_HOME的环境变量.

    sudo vim .bashrc
    export GITLAB_HOME=/srv/gitlab
    source .bashrc
    
    root@DESKTOP-1T50PP8:~# cat .bashrc| grep GITLAB
    export GITLAB_HOME=/srv/gitlab
    
    root@DESKTOP-1T50PP8:~# echo $GITLAB_HOME
    /srv/gitlab
    
  3. 照着gitlab官网准备一个docker-compose.yml

    version: '1.0'
    services:
      web:
    	image: 'gitlab/gitlab-ce:12.0.2-ce.0'
    	restart: always
       # hostname: 'gitlab.example.com'
       # environment:
       #   GITLAB_OMNIBUS_CONFIG: |
    	   # external_url 'https://gitlab.example.com'
    		# Add any other gitlab.rb configuration here, each on its own line
    	ports:
    	  - '80:80'
    	  - '443:443'
    	  - '22:22'
    	volumes:
    	  - '$GITLAB_HOME/config:/etc/gitlab'
    	  - '$GITLAB_HOME/logs:/var/log/gitlab'
    	  - '$GITLAB_HOME/data:/var/opt/gitlab'
    	shm_size: '256m'
    
  4. 在docker-compose.yml目录执行 docker compose up -d启动gitlab

restore gitlab

  1. 进入gitlab容器,查看备份文件需在的位置

    docker exec -it gitlab-web-1 /bin/sh
    # cat /etc/gitlab/gitlab.rb | grep backup_path
    # gitlab_rails['manage_backup_path'] = true
    # gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
    # exit
    
  2. 把备份文件拷贝到 $GITLAB_HOME/data/backup后,执行 docker exec -it gitlab-web-1 gitlab-rake gitlab:backup:restore BACKUP=1619799951_2021_04_30_12.0.2,由于gitlab版本太低只能用这个命令。
    image

    Unpacking backup ... done
    Before restoring the database, we will remove all existing
    tables to avoid future upgrade problems. Be aware that if you have
    custom tables in the GitLab database these tables and all data will be
    removed.
    Do you want to continue (yes/no)? y
    Do you want to continue (yes/no)? yes
    Removing all tables. Press `Ctrl-C` within 5 seconds to abort
    2023-02-21 03:05:40 +0000 -- Cleaning the database ...
    2023-02-21 03:05:52 +0000 -- done
    2023-02-21 03:05:52 +0000 -- Restoring database ...
    Restoring PostgreSQL database gitlabhq_production ... SET
    SET
    SET
    SET
    SET
     set_config
     ....
    WARNING:  no privileges were granted for "public"
    GRANT
    [DONE]
    2023-02-21 03:09:00 +0000 -- done
    2023-02-21 03:09:00 +0000 -- Restoring repositories ...
     * Ops/work-log ... [DONE]
     * az/lg-szit ... [DONE]
     ...
    2023-02-21 03:17:27 +0000 -- done
    2023-02-21 03:17:27 +0000 -- Restoring uploads ...
    2023-02-21 03:17:27 +0000 -- done
    2023-02-21 03:17:27 +0000 -- Restoring builds ...
    2023-02-21 03:17:27 +0000 -- done
    2023-02-21 03:17:27 +0000 -- Restoring artifacts ...
    2023-02-21 03:17:28 +0000 -- done
    2023-02-21 03:17:28 +0000 -- Restoring pages ...
    2023-02-21 03:17:28 +0000 -- done
    2023-02-21 03:17:28 +0000 -- Restoring lfs objects ...
    2023-02-21 03:17:28 +0000 -- done
    This task will now rebuild the authorized_keys file.
    You will lose any data stored in the authorized_keys file.
    Do you want to continue (yes/no)? yes
    
    Deleting tmp directories ... done
    done
    done
    done
    done
    done
    done
    done
    Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data
    and are not included in this backup. You will need to restore these files manually.
    Restore task is done.
    

标签:02,restore,21,03,--,gitlab,12.0,done
From: https://www.cnblogs.com/stxz/p/17140493.html

相关文章

  • 命令行修改gitlab管理员密码
    进入gitlab容器执行gitlab-railsconsoleproduction,命令:dockerexec-itgitlab-web-1gitlab-railsconsoleproductionroot@DESKTOP-1T50PP8:/srv/gitlab/config#......
  • linux服务器gitlab设置普通用户为超级管理员
    登录gitlab后台之后,如果判断账号是不是超级管理员呢1、看导航栏,是否有这个图标,如果有表示是超级管理员,如果没有则不是。 2、地址栏直接加admin访问,例如:192.168.1.22/ad......
  • docker 部署gitlab
    docker部署mkdir-p/mnt/docker/gitlab/config#作为配置目录mkdir-p/mnt/docker/gitlab/logs#作为日志目录mkdir-p/mnt/date/gitlab#作为......
  • windows下gitlab-ci.yml配置进入某一目录找不到,无权限
    打开任务管理器查看gitlab-runner所使用的的用户更改gitlab-runner服务权限,找到gitlab-runner服务,右键-属性-登陆,选择【此账户】点击【浏览】  选择具有权限的账......
  • gitlab 初始密码
    方法一:gitlab-ce初装以后,把密码放在了一个临时文件中了#cat/etc/gitlab/initial_root_passwordPassword:ARVVjpDcF5g/ZG2DScarmU9s9TKUT09HQd3qUj4jq/c=12这......
  • gitlab修改分支名称
    第一步:先修改本地分支重命名  第二步:删除远程分支 第三步:将本地分支推送到远程分支上,如果远程分支不存在,则创建此远程分支  原文章地址:https://blog.csdn.......
  • Jenkins+Net Core3.1+Gitlab实现 CICD(未完成版)
    架构说明:由浅入深,我们暂时不考虑分布式,安装Jenkins到用户服务器进行CICD需要两台服务器Gitlab:192.168.232.128:12080源代码仓库,可以参考《安装git......
  • windows下通过docker安装gitlab
    1.下载dockerhttps://docs.docker.com/desktop/install/windows-install/按照步骤往下走2.打开cmd运行dockersearchgitlab/gitlab-cedockerpullgitlab/gitlab-ce......
  • 在使用Gitlab API获取仓库中的项目的几点说明
    1、不能获取仓库中的全部项目出于性能考虑Gitlab不能一次性获得仓库中的全部项目,GitlabAPI默认做了分页处理,如果未提交分页参数,会默认只显示20条。2、用于分页显示的两......
  • GitLab CICD Day 14 - 專案演練 part 1 設定 Pipeline
    创建DockerfileFROMdenoland/deno:alpine-1.26.0WORKDIR/appCOPY./appEXPOSE8000RUNdenocachemain.tsCMD["run","--allow-all","main.ts"].dockerignore 忽略......