Skip to content

Instantly share code, notes, and snippets.

@yjkim1-ntels
Created March 18, 2021 04:37
Show Gist options
  • Save yjkim1-ntels/f57aa2af41834f599b332506a83a0499 to your computer and use it in GitHub Desktop.
Save yjkim1-ntels/f57aa2af41834f599b332506a83a0499 to your computer and use it in GitHub Desktop.
gitlab install
/!bin/bash
# CI_HOST=chf-kube-ci.com # dns 사용시, runn 사용시 추가
CI_IP=192.168.15.20
: '
# runner 사용시
docker run -d --restart always --name gitlab \
--add-host ${CI_HOST}:${CI_IP} \
-p 10080:10080 -p 10443:10443 -p 10022:10022 -p 5005:5005 \
-v ${PWD}/config:/etc/gitlab \
-v ${PWD}/logs:/var/log/gitlab \
-v ${PWD}/data:/var/opt/gitlab \
-e GITLAB_OMNIBUS_CONFIG="external_url 'http://$CI_HOST:10080/'; gitlab_rails['gitlab_shell_ssh_port'] = 10022 ; nginx['listen_port'] = 10080; registry_external_url = 'https://$CI_HOST:5005' "
\ gitlab/gitlab-ee:latest
'
docker run -d --restart always --name gitlab \
-p 10080:10080 -p 10443:10443 -p 10022:10022 -p 5005:5005 \
-v ${PWD}/config:/etc/gitlab \
-v ${PWD}/logs:/var/log/gitlab \
-v ${PWD}/data:/var/opt/gitlab \
-e GITLAB_OMNIBUS_CONFIG="external_url 'http://$CI_IP:10080/'; gitlab_rails['gitlab_shell_ssh_port'] = 10022 ; nginx['listen_port'] = 10080; registry_external_url = 'https://$CI_IP:5005' " \
gitlab/gitlab-ee:latest
@yjkim1-ntels
Copy link
Author

yjkim1-ntels commented Mar 18, 2021

# gitlab_rails['db_adapter'] = "postgresql"
# gitlab_rails['db_encoding'] = "unicode"
# gitlab_rails['db_collation'] = nil
# gitlab_rails['db_database'] = "gitlabhq_production"
# gitlab_rails['db_pool'] = 10
# gitlab_rails['db_username'] = "gitlab"
# gitlab_rails['db_password'] = nil

@yjkim1-ntels
Copy link
Author

yjkim1-ntels commented Mar 18, 2021

# database connect 
gitlab-rails dbconsole
 
# show database 
\l

# show tables 
\dt

# select gitlab users 
select * from users;

@yjkim1-ntels
Copy link
Author

yjkim1-ntels commented Mar 18, 2021

# 포스트그리 로그 :
gitlab-ctl tail postgres
#엔진액스 로그 : 
gitlab-ctl tail nginx
 
#상태 확인 방법
gitlab-ctl status
 
#시작 종료
gitlab-ctl start
gitlab-ctl stop
 
#예를들어 엔진액스만 실행
gitlab-ctl start nginx

@yjkim1-ntels
Copy link
Author

# get rpm 
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

@yjkim1-ntels
Copy link
Author

yum --showduplicates list gitlab-ee
yum install gitlab-ee-12.10.5-ee.0.el7
yum install gitlab-ee-13.9.3-ee.0.el7

@yjkim1-ntels
Copy link
Author

sudo systemctl start gitlab-runsvdir.service

@yjkim1-ntels
Copy link
Author

# private registry enable http 
registry_external_url = 'http://registry.yjkim.com:5005'
gitlab_rails['registry_host'] = "registry.yjkim.com"
registry_nginx['enable'] = true # yjkim1
registry_nginx['listen_port'] = 5005 # yjkim1

@yjkim1-ntels
Copy link
Author

# print project path 
Project.find_each do |project|
  puts "#{project.id}|#{project.namespace.path.to_s}|#{project.name.to_s}| #{project.disk_path.to_s} "
end
38|W_UDBS|EMS Server| @hashed/ae/a9/aea92132c4cbeb263e6ac2bf6c183b5d81737f179f21efdc5863739672f0f470 
52|QCMS|client| @hashed/41/cf/41cfc0d1f2d127b04555b7246d84019b4d27710a3f3aff6e7764375b1e06e05d 

@yjkim1-ntels
Copy link
Author

helm repo add gitlab https://charts.gitlab.io/
helm repo update
helm get values gitlab > gitlab.yaml
helm upgrade gitlab gitlab/gitlab -f gitlab.yaml

@yjkim1-ntels
Copy link
Author

gitlab-rails console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment