Skip to content

Latest commit

 

History

History
78 lines (51 loc) · 1.35 KB

travis.md

File metadata and controls

78 lines (51 loc) · 1.35 KB

travis

CLI安装

$ gem install travis

登录

$ travis login

验证.travis.yml合法性

$ travis lint

加密

添加环境变量

添加git push权限

生成SSH Key

$ cd ~/.ssh
$ ssh-keygen -t rsa -C "bell@greedlab.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/bell/.ssh/id_rsa): ssh_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in ssh_key.
Your public key has been saved in ssh_key.pub.

进入仓库本地目录

公钥加到仓库

ssh_key.pub添加到GreedBell/blog > Settings > Deploy keys > add deploy key

加密私钥

$ travis encrypt-file ~/.ssh/ssh_key --add -r GreedBell/blog

修改.travis.yml

  • -out ssh_key改为-out ~/.ssh/id_rsa

  • 修改id_rsa权限

- chmod 600 ~/.ssh/id_rsa
  • 设置用户
git config user.email "bell@greedlab.com"
git config user.name "Bell"