반응형
GitLab
효과적인 팀 프로젝트 개발 환경과 형상 관리를 위한 GitLab 도입
- GitLab은 Git 원격 저장소(Repository) 관리 뿐만 아니라, 이슈 트래킹, 코드 리뷰, Wiki, CI/CD, 테스트, 모니터링 등 전체 소프트웨어 개발 라이프사이클에 필요한 기능을 제공합니다.
- GitLab은 단일 애플리케이션으로 제공되는 완전한 DevOps 플랫폼입니다. 간소화된 소프트웨어 워크플로를 생성하여 서로 짜 맞추어진 툴체인의 제약에서 조직을 벗어나게 합니다.
- 현대적인 소프트웨어 개발 방법인 클라우드 네이티브(Cloud Native) 환경 구축에 필요한 DevOps, Container, Kubernetes, CI/CD를 위한 기능을 제공합니다.
GitLab 가이드 https://insight.infograb.net/guide/
설치 공식 문서 https://about.gitlab.com/install/#ubuntu
설치
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
sudo apt-get install -y postfix
postfix : 메일 발송 관련 설정, 옵션은 우선 No configuration 선택
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
host : GitLab이 올라갈 서버의 IP주소 입력
port : 포트 번호
https 권한 허용되어 있는 경우
sudo EXTERNAL_URL="https://host:port/" apt-get install gitlab-ee
허용되지 않은 경우
위의 명령어 실행 중 다음과 같은 오류 발생
Running handlers:
There was an error running gitlab-ctl reconfigure:
letsencrypt_certificate[host] (letsencrypt::http_authorization line 3) had an error: Faraday::ConnectionFailed: acme_certificate[staging] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/letsencrypt/resources/certificate.rb line 20) had an error: Faraday::ConnectionFailed: Failed to open TCP connection to acme-staging.api.letsencrypt.org:443 (getaddrinfo: Name or service not known)
https 권한 문제 → gitlab.rb 루비파일#13 확인 후 external_url="<http://host:port/>" 로 변경
변경 후 gitlab 적용, 재시작
gitlab-ctl reconfigure
gitlab-ctl restart
GitLab 상태 확인
gitlab-ctl status
external_url https → http 변경 후 로그인 시 422 에러
쿠키 문제이므로, 쿠키 삭제 후 재접속하면 정상 작동한다.
(Chrome) 설정 → 개인 정보 보호 및 보안 → 인터넷 사용 기록 삭제 → 쿠키 및 기타 사이트 데이터 선택 후 인터넷 사용 기록 삭제
GitLab SSH 설정
You won’t be able to pull or push repositories via SSH until you add an SSH key to your profile
위와 같은 SSH 설정 관련 경고 문구가 표시될 경우
SSH 설정을 해야 SSH 키를 사용한 GitLab 사용이 가능하다. (설정하지 않아도 http를 이용한 사용은 가능)
SSH 키 받기
ssh-keygen
- key 저장 위치 기본(c/Users/{user}/.ssh/id_rsa) → 엔터
- passphrase → 엔터(no passphrase)
- passphrase 확인 → 엔터
ssh-rsa 확인
cat /c/Users/{user}/.ssh/id_rsa.pub
GitLab 등록
개인 settings → SSH keys → 위에서 확인한 결과값을 key에 입력 → add key
완료
SSH을 통한 GitLab 사용 가능!
반응형
'Development' 카테고리의 다른 글
[Linux] nohup 명령어 (0) | 2023.08.25 |
---|---|
[nginx] Failed to allocate directory watch: Too many open files (0) | 2023.08.10 |
[Ubuntu] 자주 사용하는 명령어 (0) | 2023.08.09 |
[nginx] http to https redirection 설정 (0) | 2023.08.01 |
Daemon 알아보기 (0) | 2023.07.24 |