billryan / algorithm-exercise

Data Structure and Algorithm notes. 数据结构与算法/leetcode/lintcode题解/

Home Page:https://algorithm.yuanbin.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how did you sync to qiniu?

district10 opened this issue · comments

我看了 travis 文件,没有看到同步七牛的部分……整个 repo 里有一个 qiniu_sync.json,但是里面的密钥肯定不能用。特别想知道你怎么把自动同步到了七牛 😄

好问题 :) 因为怀疑有人恶意盗链把我七牛的免费流量全用光了,所以后面我把七牛同步的脚步删掉了。历史记录见 https://github.com/billryan/algorithm-exercise/blob/6d6f08093fc106b53673519873e3949b6f222803/.travis.yml

  1. 下七牛同步命令行工具
  2. travis 中自定义私钥
  3. 替换配置文件

原来如此!看到了,可以自己到 travis 的 repo 里设置环境变量。

自己笔记一下:

  • https://travis-ci.org/<github-id>/<repo-name>/settings
  • 设置 Environment Variables
  • 然后用 sed 改掉 conf.json 里面的密钥:sed -i "s/AccessKey/$QAK/g" conf.json

Voila~ 我也成功地把它同步到了七牛:https://github.com/district10/hacking-travis

恭喜~ 👍