본문 바로가기
programming/facebook

Facebook heroku계정 사용하기

by hotdogya 2012. 7. 12.

https://devcenter.heroku.com/articles/facebook

이곳  동영상에 잘 나와 있다. 밑에 설명도 잘 나와있고 ㅎㅎ


그래도 실습차 따라하며 정리


새앱만들기를 클릭한다.


웹 호스팅을 체크한다. heroku 계정으로 호스팅이 생긴다.


환경은 각자의 개발환경으로 맞춰주고(난 php) 만들기 선택



Success!! 뭔가 잘 된거다. ㅋㅋ 앱으로 가보자 Go to App 클릭~!!


오옷~!!

  위 처럼   heroku 계정으로 샘플앱이 만들어져 있다.




이제 페이지를 수정해야 한다!! 각자의 기호에 맞게 ㅎㅎ

https://devcenter.heroku.com/articles/quickstart 이곳을 참조하자


https://toolbelt.heroku.com/ 에 접속해서 각자의 OS에 맞는  toolbelt를 다운 받는다.

설치 하고

터미널을 실행한다. (윈도우에서는 cmd.exe)


heroku login을 입력한다.

이미 접속을 했었기 때문에 이런 화면이 나온다.

만약 처음 접속했으면 아래와 같은 화면이 나온다.

$ heroku login
Enter your Heroku credentials.
Email: adam@example.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn]
Generating new SSH public key.
Uploading ssh public key /Users/adam/.ssh/id_rsa.pub

 ssh공개키를 생성할거에요? 라고 물어보면 Y 입력. 어차피 동의 안하면 사용도 못한다.



다음~!!

heroku 계정을 체크아웃(?) 받는다.


git clone git@heroku.com:gentle-sky-1903.git -o heroku


이렇게 입력하면 된다. 밑줄친 부분은 각자의 계정에 맞게 적어준다.

#밑줄친 계정 정보 확인 법

https://api.heroku.com/myapps/ 에 접속한다.



해당하는 계정의 General Info 버튼을 클릭하고 


밑줄 친 요거 이게 Git Repository이다.

이 주소의 소스를 클론해서 로컬에서 수정후 다시 커밋 하면 된다.


다음 git remote라고 입력해 보자

$ git remote
heroku

이렇게 나올거다.

근데 난 이렇게 나온다. ㅠㅠ 왜 안되는거냐;;;

$ git remote
fatal: Not a git repository (or any of the parent directories): .git

안나온다면 리모트를 추가하자.

$ git remote add heroku git@heroku.com:furious-robot-218.git

난 그래도 안된다. ㅠㅠ;;

왜 그런지 모르겠지만 그냥 패스하고 진행해도 되긴 한다.


이제 파일을 수정하자. 다은 받은 파일중 index.php파일을 수정해 보자.

난 Hello World!!!! my first app! 이라는 문구를 넣었다.

 

그다음 커밋한다.


:gentle-sky-1903 khs$ git commit -am "커밋 내용"
[master 7c33d28] commit
 Committer: HS Kang <khs@Marshal-ui-MacBook-Pro.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 files changed, 1 insertions(+), 0 deletions(-)
:gentle-sky-1903 khs$ 
커밋완료.

이제 git에 커밋한 내용을 heroku에 푸쉬한다.
:gentle-sky-1903 khs$ git push heroku
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 328 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)

-----> Heroku receiving push
-----> Git submodules detected, installing
       Submodule 'sdk' (https://github.com/facebook/facebook-php-sdk.git) registered for path 'sdk'
       Initialized empty Git repository in /tmp/build_2q0uylpdplehq/sdk/.git/
       Submodule path 'sdk': checked out '6c82b3fdfb8efd27751de028d75fd3ab1f2c1ade'
-----> PHP app detected
-----> Bundling Apache version 2.2.22
-----> Bundling PHP version 5.3.10
-----> Discovering process types
       Procfile declares types -> (none)
       Default types for PHP   -> web
-----> Compiled slug size is 9.7MB
-----> Launching... done, v4
       http://gentle-sky-1903.herokuapp.com deployed to Heroku

To git@heroku.com:gentle-sky-1903.git
   fef63e4..7c33d28  master -> master
:gentle-sky-1903 khs$ 

ㅇㅋ 이제 완료다.

수정한 문구가 추가된걸 볼 수 있다.





#추가적인 git 명령어

git status : 현재 상태를 알 수 있음. 현재는 index.php파일이 수정되었다고 보여짐.

:gentle-sky-1903 khs$ git status # On branch master nothing to commit (working directory clean) :gentle-sky-1903 khs$ vi index.php :gentle-sky-1903 khs$ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: index.php # no changes added to commit (use "git add" and/or "git commit -a") :gentle-sky-1903 khs$

git add 파일명 : 새로 만든 파일을 index에 추가하여 커밋하게 해준다. 새로만든 파일을 커밋할때 실행해주자.

git rm 파일명 : index에서 이 파일을 제거 한다. 




'programming > facebook' 카테고리의 다른 글

페이지에 페이지탭 추가  (0) 2012.07.06
offline_access 사용 불가 유효기간 연장법  (4) 2012.04.24
페이지탭 설정  (0) 2012.04.18
pageid 가져오기  (0) 2012.04.17
facebook 팬페이지 확인하기  (0) 2012.04.17