This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# index action을 가진 Welcome Controller 만들기 | |
cd blog | |
./bin/rails generate controller Welcome index | |
# 현재의 git branch 목록 확인 | |
git branch | |
# develop branch를 추가하고 branch로 commit 하기 | |
git branch develop | |
git branch -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# github에서 생성한 repository에 연결하기 위한 ssh key 생성하기 | |
ssh-keygen -t rsa | |
# 생성된 key를 github repository에 등록 (발표자료 참조) | |
# blog app 경로로 이동 후 git init 실행 | |
cd blog; | |
git init | |
# github의 사용자 계정 연결 (아래의 이메일, 사용자 이름 중 하나를 선택하여 진행) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jenkins 서버에 설치 | |
# ubuntu 16.04 필요 | |
# git, openjdk-8 설치 | |
sudo apt-get update;sudo apt-get install git openjdk-8-jdk -y | |
# jenkins debian package repository key 설정 | |
sudo wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add - | |
# jenkins repository 주소 설정 | |
sudo echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jenkins user가 capistrano를 이용한 배포를 할 수 있도록 Jenkins 서버에 접속해서 Jenkins 계정으로 이전의 ruby, rails, bundler 설치를 진행한다. | |
# 먼저 jenkins user가 app 서버에 접근할 수 있도록 이전에 설장한 사용자 계정의 id_rsa ssh key를 젠킨스 디렉토리로 복사 후 사용 권한을 설정한다. | |
sudo cp ~/.ssh/id_rsa /var/lib/jenkins/.ssh/id_rsa; | |
sudo chown jenkins:jenkins /var/lib/jenkins/.ssh/id_rsa; | |
sudo chmod 400 /var/lib/jenkins/.ssh/id_rsa; | |
# 이후 jenkins 계정으로 전환 | |
sudo su - jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 배포 서버의 접근을 위한 Jenkins 서버의 ssh key를 App server에 등록 | |
# jenkins 서버에서 다음의 명령어로 파일 내용을 확인 후 app 서버의 동일한 경로에 같은 파일 명으로 저장 | |
cat ~/.ssh/id_rsa | |
cat ~/.ssh/id_rsa.pub | |
# 위의 두가지 파일 내용을 각각 id_rsa 파일은 App server의 동일한 경로로 복사하고 | |
# id_rsa.pub 파일은 App server의 동일한 경로에 authorized_keys 파일 안에 추가한다. | |
# App server에 접속해서 다음의 명령어를 입력하여 위의 key를 각각 파일에 추가 붙여넣기 후 저장한다. | |
cd;mkdir ~/.ssh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jenkins user가 capistrano를 이용한 배포를 할 수 있도록 Jenkins 서버에 접속해서 Jenkins 계정으로 이전의 ruby, rails, bundler 설치를 진행한다. | |
# 먼저 jenkins user가 app 서버에 접근할 수 있도록 이전에 설장한 사용자 계정의 id_rsa ssh key를 젠킨스 디렉토리로 복사 후 사용 권한을 설정한다. | |
sudo cp ~/.ssh/id_rsa /var/lib/jenkins/.ssh/id_rsa; | |
sudo chown jenkins:jenkins /var/lib/jenkins/.ssh/id_rsa; | |
sudo chmod 400 /var/lib/jenkins/.ssh/id_rsa; | |
# 이후 jenkins 계정으로 전환 | |
sudo su - jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 배포 서버의 접근을 위한 Jenkins 서버의 ssh key를 App server에 등록 | |
# jenkins 서버에서 다음의 명령어로 파일 내용을 확인 후 app 서버의 동일한 경로에 같은 파일 명으로 저장 | |
cat ~/.ssh/id_rsa | |
cat ~/.ssh/id_rsa.pub | |
# 위의 두가지 파일 내용을 각각 id_rsa 파일은 App server의 동일한 경로로 복사하고 | |
# id_rsa.pub 파일은 App server의 동일한 경로에 authorized_keys 파일 안에 추가한다. | |
# App server에 접속해서 다음의 명령어를 입력하여 위의 key를 각각 파일에 추가 붙여넣기 후 저장한다. | |
cd;mkdir ~/.ssh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 설치를 위한 PGP키 등록 | |
sudo apt-get install dirmngr gnupg -y | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 | |
sudo apt-get install apt-transport-https ca-certificates -y | |
# Package repository 정보 등록 | |
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list';sudo apt-get update | |
# Nginx, Passenger 설치 | |
sudo apt-get install curl openssl libssl-dev nginx-extras passenger -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# github에서 생성한 repository에 연결하기 위한 ssh key 생성하기 | |
ssh-keygen -t rsa | |
# 생성된 key를 github repository에 등록 (발표자료 참조) | |
# blog app 경로로 이동 후 git init 실행 | |
cd blog; | |
git init | |
# github의 사용자 계정 연결 (아래의 이메일, 사용자 이름 중 하나를 선택하여 진행) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ubuntu 16.04 서버에서 ruby 설치 | |
sudo apt-get update | |
# ruby와 rbenv 설치를 위한 의존성 패키지 설치 | |
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev -y | |
# rails app 생성을 위한 nodejs, sqlite3 설치 | |
sudo apt-get install nodejs libsqlite3-dev -y | |
# superuser 권한없이 rails를 사용하기 위한 rbenv 설치 |
NewerOlder