是什么原因让你折腾travis?是懒!懒!懒!每次提交代码后台又要手动输一次hexo d -g
,真心觉得麻烦,作为程序猿,就应该学会偷懒,可以少输几次相同的命令,心情甚是愉悦。
当然之前也有接触过travis,比如x-citravis的简单使用,团队博客的部署。
相关步骤记录
travis-ci 添加项目
使用github账号登录travis 并添加相关的项目
GitHub生成Personal Access Token
settings->Developer settings->Personal access tokens->点击Generate new token
生成完后拷贝记录下来,后面travis
登录需要用到。刷新页面后台token
将不可见,只能重新生成。
配置.travis.yml
1 | ➜ gem install travis --no-rdoc --no-ri |
如果安装travis无反应,可以更新
gem sources --add https://gems.ruby-china.org/
国内镜像源
然后看下.travis.yml
是不是增加了:
1 | - openssl aes-256-cbc -K $encrypted_11753ec45e06_key -iv $encrypted_11753ec45e06_iv |
travis No such file or directory:bss_file.c:398:fopen(‘~/.ssh/id_rsa’,’w’)1
2
3
`-out ~\/.ssh/id_rsa -d` -> `-out ~/.ssh/id_rsa -d`
- https://github.com/travis-ci/travis.rb/issues/555
remote: Invalid username or password.
fatal: Authentication failed for ‘https://github.com/huixisheng/huixisheng.github.com.git/'
FATAL Something’s wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: remote: Invalid username or password.1
2
在`.travis.yml`添加`ssh -T git@github.com`测试,发现ssh的配置是没问题的。
0.59s$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address ‘192.30.253.112’ to the list of known hosts.
Hi cosmeapp/cosmeapp.github.com! You’ve successfully authenticated, but GitHub does not provide shell access.
The command “ssh -T git@github.com“ failed and exited with 1 during .`
再次添加travis-ci
居然成功了。