2016-08-16 3 views
0

this 지침을 따르려고합니다.travis-ci에서 gh-pages로 배포하려고 시도했습니다.

내 트래비스 로그는 here입니다.

0.01s$ openssl aes-256-cbc -K $encrypted_4b2755af321b_key -iv $encrypted_4b2755af321b_iv -in etc/deploy.enc -out ~/.ssh/publish-key -d 
before_install.2 
0.00s$ chmod u=rw,og= ~/.ssh/publish-key 
before_install.3 
0.00s$ echo "Host github.com" >> ~/.ssh/config 
before_install.4 
0.00s$ echo " IdentityFile ~/.ssh/publish-key" >> ~/.ssh/config 
before_install.5 
0.00s$ git --version 
git version 1.8.5.6 
before_install.6 
0.01s$ git remote set-url origin [email protected]:zaun/riot-ui.git 
$ git fetch origin -f gh-pages:gh-pages 
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts. 
Enter passphrase for key '/home/travis/.ssh/publish-key': 
Done: Job Cancelled 

작업이 /home/travis/.ssh/publish-key과 정지됩니다. 키에는 암호가 없습니다. Enter을 누르면 스크립트가 계속 실행됩니다. 내가 잘못

before_install: 
    - openssl aes-256-cbc -K $encrypted_4b2755af321b_key -iv $encrypted_4b2755af321b_iv -in etc/deploy.enc -out ~/.ssh/publish-key -d 
    - chmod u=rw,og= ~/.ssh/publish-key 
    - ssh-keyscan github.com >> ~/.ssh/known_hosts 
    - echo "Host github.com" >> ~/.ssh/config 
    - echo " IdentityFile ~/.ssh/publish-key" >> ~/.ssh/config 
    - git --version 
    - git remote set-url origin [email protected]:zaun/riot-ui.git 
    - git fetch origin -f gh-pages:gh-pages 

를하고있는 중이 야 무엇 : 키를 다루는

before_install 단계는이 무엇입니까? 어떻게 작동 시키나요?

답변

0

대신 ssh 에이전트를 사용해보십시오.

addons: 
    ssh_known_hosts: github.com 

before_script: 
- openssl aes-256-cbc -K $encrypted_4b2755af321b_key -iv $encrypted_4b2755af321b_iv -in etc/deploy.enc -out publish-key -d 
- chmod 600 publish-key 
- eval `ssh-agent -s` 
- ssh-add publish-key 

타사 스크립트가 키를 노출하지 않도록 최대한 늦게 처리하는 것이 더 안전 할 수 있습니다. 개인적으로 내 after_success 스크립트에서 git 명령을 사용하기 전에이 작업을 수행합니다.

전체 예제를 보려면 this repository을 참조하십시오.

0

git 입력을 기다리는 경우에, 당신은 그것을 줄 바꿈 먹이를 시도 할 수 있습니다 :

before_install: 
    ⋮ 
    - echo | git fetch origin -f gh-pages:gh-pages 
관련 문제