1. travis

1.1. CLI安装

$ gem install travis

1.2. 登录

$ travis login

1.3. 验证.travis.yml合法性

$ travis lint

1.4. 加密

1.5. 添加环境变量

1.6. 添加git push权限

1.6.1. 生成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.

1.7. 进入仓库本地目录

1.8. 公钥加到仓库

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

1.9. 加密私钥

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

1.10. 修改.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"

results matching ""

    No results matching ""