选择大连网站建设如何创建自己的小程序
这里我们为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: gitlabrestart: alwaysenvironment:GITLAB_OMNIBUS_CONFIG: |external_url 'http://192.168.19.6:8929'gitlab_rails['gitlab_shell_ssh_port'] = 2224ports:- '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=
-
修改密码为:a897546s
可以修改为自己喜欢的密码
http://192.168.19.6:8929/-/profile/password/edit