基于Kubernetes集群构建大中型企业CICD应用平台(2)--code阶段工具gitlab安装

这里我们为gitlab服务器准备一台虚拟机:192.168.19.6-gitlab服务器

在code阶段,我们需要将不同版本的代码存储到一个仓库中,常见的版本控制工具就是SVN或者Git,这里我们采用Git作为版本控制工具,GitLab作为远程仓库。

Git(傻瓜式安装)

2.1、gitlab安装

单独准备服务器,采用Docker安装。这里需要先安装好docker和docker-compose

  • 拉取gitlab镜像

docker pull gitlab/gitlab-ce
  • 编写docker-compose.yml文件

在/usr/local/docker/gitlab-docker目录下编写docker-compose.yml文件,文件的具体内容如下:

external_url: 按照docker-compose的服务的IP地址

version: '3.1'
services:
  gitlab:
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.19.6:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '8929:8929'
      - '2224:2224'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'
  • 启动docker-compose

[root@localhost docker]# docker-compose up -d
Creating network "docker_default" with the default driver
Creating gitlab ... done
  • 访问GitLab首页

    在浏览器上输入192.168.19.6:8929

    账号使用root,密码:eH+xJVXetYyhvoeMOg88kPVgSz8gA9IES+S+KhRJAWI=

  • 查看root用户的初始密码

    [root@localhost docker]# docker exec -it gitlab cat /etc/gitlab/initial_root_password
    # WARNING: This value is valid only in the following conditions
    #          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
    #          2. Password hasn't been changed manually, either via UI or via command line.
    #
    #          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
    ​
    Password: eH+xJVXetYyhvoeMOg88kPVgSz8gA9IES+S+KhRJAWI=
    ​
    # NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours

    从这里可以看出gitlab的root账号的初始密码是:eH+xJVXetYyhvoeMOg88kPVgSz8gA9IES+S+KhRJAWI=

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值