[root@deployment /]# cat /opt/gitlab/config/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.
# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
安装GitLab Runner
下载并安装二进制文件
# Download the binary for your system curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
# Give it permissions to execute chmod +x /usr/local/bin/gitlab-runner
# Create a GitLab CI user useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
# Install and run as service gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner gitlab-runner start
[root@deployment /]# gitlab-runner register Runtime platform arch=amd64 os=linux pid=86642 revision=58ba2b95 version=14.2.0 Running in system-mode. Enter the GitLab instance URL (for example, https://gitlab.com/): http://192.168.50.52:9090/ Enter the registration token: cZ8xxddc9zciAHAsJpqB Enter a description for the runner: [deployment]: test Enter tags for the runner (comma-separated): test Registering runner... succeeded runner=cZ8xxddc Enter an executor: docker, docker-ssh, parallels, shell, virtualbox, kubernetes, custom, ssh, docker+machine, docker-ssh+machine: shell Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=192.168.50.52%3A8551%2Fymall%3Alatest&target=&ulimits=null&version=1: dial unix /var/run/docker.sock: connect: permission denied
service docker stop su docker sudo service docker start
我这里仅为测试GitLab-CI,故直接添加docker到gitlab-runner组
usermod -aG docker gitlab-runner
拉取Git仓库时报错
Initialized empty Git repository in /private/var/folders/g5/8twmk1xj481_6btvppyw5j4h0000gp/T/.tmpNYVg6H/.git/ hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name>
[root@iZ2zeaxvb40ng4w24tpogoZ file]# cat /file/backup.sh cd /file/ tar zcvf gitlabconfig`date +%F`.tar config tar zcvf gitlabdata`date +%F`.tar data mv *.tar /data1/gitlab/backup/
gitlab配置ldap
vim /file/config/gitlab.rb gitlab_rails['ldap_enabled'] = true gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' main: # 'main' is the GitLab 'provider ID' of this LDAP server label: 'LDAP' host: '39.107.142.154' port: 389 uid: 'cn' bind_dn: 'cn=admin,dc=gzlplink,dc=com' password: 'Lpldap123456' encryption: 'plain' # "start_tls" or "simple_tls" or "plain" verify_certificates: true active_directory: true #邮箱 用户名均可登录 allow_username_or_email_login: true lowercase_usernames: false #不允许用户注册 block_auto_created_users: false base: 'ou=研发部,cn=admin,dc=gzlplink,dc=com' user_filter: '' attributes: username: ['cn'] email: ['mail'] name: 'description' first_name: 'givenName' last_name: 'sn' EOS