2016-08-16 9 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ステップはこれです:私は間違っ

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 

何をしているのですか?これをどのように機能させるには?

答えて

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 
関連する問題