본문 바로가기
IT/Heroku

[Heroku] - 헤로쿠 CLI(Command Line Interface) 설치방법 및 명령어 사용법

by 차이나는 개발자 2022. 7. 4.
728x90
반응형

#헤로쿠 CLI(Command Line Interface) 설치방법 및 명령어 사용법

-인터페이스(CLI)를 사용하면 터미널에서 직접 Heroku 앱을 만들고 관리할 수 있습니다.

 

 

#헤로쿠 설치전 Git 설치

-Heroku CLI에는 널리 사용되는 버전 제어 시스템인 Git 이 필요합니다.

-Git이 설치되어 있지 않다면 Git을 먼저 설치해야합니다.

-깃 설치 url입니다.

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

 

Git - Installing Git

This book was written using Git version 2.8.0. Though most of the commands we use should work even in ancient versions of Git, some of them might not or might act slightly differently if you’re using an older version. Since Git is quite excellent at pres

git-scm.com

 

 

#헤로쿠 설치 url입니다.

https://devcenter.heroku.com/articles/heroku-cli#verify-your-installation

 

The Heroku CLI | Heroku Dev Center

Last updated April 26, 2022 The Heroku Command Line Interface (CLI) lets you create and manage Heroku apps directly from the terminal. It’s an essential part of using Heroku. Install the Heroku CLI Pre-requisites The Heroku CLI requires Git, the popular

devcenter.heroku.com

 

-하단에 해당 화면을 찾은 후 본인의 OS에 맞게 설치파일을 다운로드 받습니다.

 

 

#다운받은 헤로쿠 파일을 실행합니다.

 

-전부 Default 값을 클릭합니다.

 

 

#윈도우 키 + R -> cmd 입력 후 명령프롬프트 실행하고 헤로쿠가 설치된 것을 확인합니다.

(이제 heroku로 시작하는 명령어를 사용할 수 있습니다.)

$ heroku version

 

 

#헤로쿠 주요 CLI 명령어

-헤로쿠의 CLI의 기능을 사용하기 위해서는 먼저 로그인을 해야합니다.

(헤로쿠 홈페이지로 이동하는데 회원가입 후 로그인을 합니다.)

$ heroku login

 

-로그인 완료 페이지입니다.

 

-로그인이 완료되었습니다.

 

 

#로그아웃

(컴퓨터를 껏다 켜도 로그인이 유지된 상태이기 때문에 로그아웃을 하려면 logout 명령어를 사용해줘야 합니다.)

$ heroku logout

 

-로그아웃이 완료되었습니다.

 

 

#헤로쿠앱을 만드는 방법입니다. (이름 랜덤)

$ heroku create

 

 

 

#헤로쿠앱을 만드는 방법입니다. (이름 지정)

-헤로쿠앱명은 모든 헤로쿠앱중에 유일한 값이여야 합니다. (중복 불가)

$ heroku create jang-exam

 

 

-헤로쿠앱이 생성된 것을 확인할 수 있습니다.

 

 

#set명령어를 사용해서 헤로쿠 저장소에 환경변수를 설정할 수 있습니다.

-(키=벨류) 형식입니다.

$ heroku config:set USER_NAME=jaffjang

 

-Error: Missing required flag: -a 에러날시 참고하시기 바랍니다.

https://pingfanzhilu.tistory.com/entry/Heroku-%ED%97%A4%EB%A1%9C%EC%BF%A0-Error-Missing-required-flag-a-app-APP-app-to-run-command-against-See-more-help-with-help-%EC%97%90%EB%9F%AC-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95

 

[Heroku] - 헤로쿠 Error: Missing required flag: -a, --app APP app to run command against See more help with --help 에러

#헤로쿠 Error: Missing required flag: -a, --app APP  app to run command against See more help with --help 에러 해결 방법 #heroku config 명령어 실행시 어떤 헤로쿠앱을 설정할건지..

pingfanzhilu.tistory.com

 

-키값 USER_NAME 벨류값 jaffjang로 헤로쿠앱 환경변수가 설정되었습니다.

 

-사이트에서도 앱 -> Settings 옵션에서 설정 및 확인이 가능합니다.

 

 

#현재 헤로쿠앱에 설정된 환경변수들의 목록을 볼수도 있습니다.

$ heroku config

 

-출력 결과입니다.

 

 

$get명령어를 사용해서 키값을 입력하면 벨류값만 받아 올 수도 잇습니다.

$ heroku config:get USER_NAME

 

-출력 결과입니다.

 

 

#unset 명령어를 사용해서 환경변수를 지울수도 있습니다.

$ heroku config:unset USER_NAME

 

-출력 결과입니다.

 

 

#헤로쿠앱의 로그를 확인할 수 있습니다.

$ heroku logs

 

-출력 결과입니다.

 

 

 

728x90
반응형

댓글