Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

dev-desktop에서 github로 푸시하기 위한 Github App

이 지침은 dev-desktop github app의 서버 측 설정과 디버깅을 위한 것입니다. 사용자는 앱 설치 URL로 안내받기만 하면 되며, 나머지는 모두 자동으로 동작해야 합니다.

모든 github 작업에는 python github 라이브러리를 사용하고 있습니다. 문서는 https://pygithub.readthedocs.io/en/latest/introduction.html 에서 확인할 수 있습니다.

App 설정 방법

  1. https://github.com/settings/apps 로 이동하십시오.
  2. New Github App
  3. 메타데이터(이름과 url)를 입력하십시오.
  4. WebHook 체크박스를 비활성화하십시오.
  5. Contents - Repository contents, commits, branches, downloads, releases, and merges.를 읽기/쓰기로 설정하십시오.
  6. Workflows - Update GitHub Action workflow files.를 읽기/쓰기로 설정하십시오.
  7. “enable on any account“로 설정하십시오.
  8. Create App
  9. https://github.com/settings/apps/{your_app_name_here} 로 이동하여 App IDapp_id.txt(gen_temp_access_token.py와 같은 폴더)에 복사하십시오.

App용 .pem 파일 생성 방법

  1. https://github.com/settings/apps/{your_app_name_here}#private-key 로 이동하여 개인 키를 생성하십시오.
  2. 다운로드가 시작되면 안전한 위치에 저장하십시오.
  3. .pem 파일을 gen_temp_access_token.py와 같은 폴더로 복사하여 dev-desktop.private-key.pem으로 이름을 지정합니다

사용자를 위한 앱 설치 방법

  1. 사용자를 https://github.com/settings/apps/{your_app_name_here}/installations 로 안내하십시오.
  2. 원하는 조직/사용자에 설치하도록 하고, 사용할 리포지토리로 제한하도록 하십시오.

특정 사용자를 위한 임시 액세스 토큰 생성 방법

  1. gen_temp_access_token.py <github_username> <github_repository_name>를 실행하십시오.

git 명령줄과의 통합

저희는 credential-helpers를 사용하고 있습니다. credential helper를 디버깅하려면 이를 사용자 공간에 두고 다음과 같이 실행하십시오.

git -c credential.helper -c credential.UseHttpPath=true /path/to/helper push origin branch

이는 ssh url로 등록된 원격 저장소에는 작동하지 않는다는 점에 유의하십시오. 반드시 https를 사용해야 합니다!

첫 번째 명령줄 인자는 get, store 또는 remove입니다. 저희의 경우, 어차피 호출할 때마다 자격 증명을 재생성하므로 get을 제외한 모든 경우에는 그냥 중단합니다(exit(0)).

실제 인자는 표준 입력을 통해 전달되며 보통 다음과 같은 형태입니다

protocol=https
host=github.com
path=your_repo.git