tomcat.~ 도메인에 들어가지지 않음.
tomcatup
으로 tomcat을 올린다.
어제 만든 BuildAndDeploy 프로젝트를 build 한다.
처음엔 build가 안됐는데 알고보니 비밀번호 설정을 잘못해서 그런거였다.
설정에서 바꿔주고 다시 빌드해보니 잘 됐다.
webapp이 생겨 있다.
화면이 잘 뜨면 성공
hello world를 fork한 뒤, https 루트를 복사한다.
Jenkins에서 바꿔준다.
clone한 뒤, jsp파일을 적당히 바꿔준다.
add - commit - push 한다.
젠킨스에서 빌드한 뒤 다시 홈페이지 들어가보면 수정이 되어 있다.
하지만 업데이트 될 때마다 일일이 빌드할 수가 없다.
주기적으로 자동 빌드가 될 수 있도록 만든다. => Trigger
Cron 기능 이용하기
Software Configuration Management = 형상 관리
버전 관리 등을 일컫는다.
Poll SCM = 여론 조사, 깃허브에 대해 조사해서 커밋한 정보가 있는지 확인할 수 있다.
Cron의 최소 단위는 1분,
요일이나 분 등 주기적으로 변경할 수 있다.
polling time을 너무 줄이면 장비에 부하, 요금이 부과될 수 있다.
webapp 디렉터리에 gcp.tar 파일을 옮긴다.
그 다음에 tar 파일을 압축 해제한다.
기존 인덱스 파일을 백업해 두고, index.html -> jsp로 수정한다.
커밋한다.
젠킨스에서 빌드한다.
다시 빌드해보면 새로운 페이지가 보인다.
EC2 인스턴스에 gitLab 설치하기
https://about.gitlab.com/install/
Download and install GitLab
Download, install and maintain your own GitLab instance with various installation packages and downloads for Linux, Kubernetes, Docker, Google Cloud and more.
about.gitlab.com
Amazon Linux를 클릭하면 설치방법이 나온다.
sshd는 이미 활성화되어있으므로 안해도 됨. firewall 또한 마찬가지
sudo yum install -y curl policycoreutils-python openssh-server openssh-clients perl
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo sed -i "s/\/el\/7/\/amazon\/2/g" /etc/yum.repos.d/gitlab_gitlab*.repo
sudo yum clean metadata
sudo yum makecache
sudo EXTERNAL_URL="http://tomcat.cloudywinter.shop" yum install -y gitlab-ce
딱 필요한 명령어는 이것
아직 인증서가 없기 때문에 https 대신 http를 넣어야 한다.
ee : Enterprise Edition = 제한이 있을 수도 있는 엔터프라이즈 버전..
ce : community Edition = 무료 버전
기존에 써있는 ee 대신 ce로 바꿨는데 설치가 안돼서 그냥 ee로 했다.
실패해서 GCP instance과 Debian으로 만들어보기로 했다.
gcp 에서 VM 인스턴스를 하나 만들어 준다.
.ssh 디렉터리에 있는 ssh키를 추가해 준다.
없으면 ssh-keygen으로 만들어 준다.
인스턴스의 ip -> route53에 내 도메인에 새로 레코드 추가해준다.
터미널에서 접속해 본다.
sudo apt-get install -y postfix
sudo apt-get install -y curl openssh-server ca-certificates perl
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.cloudywinter.shop" apt-get install gitlab-ce
ee를 cc로 변경하였다.
이 화면이 뜨면 성공!
http://gitlab.cloudywinter.shop/
Sign in · GitLab
GitLab Community Edition
gitlab.cloudywinter.shop
만든 링크로 깃랩에 들어간다.
그리고 branch를 추가한다.
mkdir git-migration
git clone --mirror https://github.com/hali-linux/hello-world.git git-migration
cd git-migration/
git push -uf http://gitlab.alibaba9.shop/johnlee/test-site --all
내 컴퓨터에서 진행한다.