gitlab配合 七牛cli工具 qupload 使用

装gitlab持续集成
安装gitlab-runner

For Debian/Ubuntu

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash

For CentOS

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash

2、

For Debian/Ubuntu

sudo apt-get install gitlab-ci-multi-runner

For CentOS

sudo yum install gitlab-ci-multi-runner

3、
$ sudo gitlab-ci-multi-runner register

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )
http://git.gittt.cn/
Please enter the gitlab-ci token for this runner
tokenxxx-xxx-xxx
Please enter the gitlab-ci description for this runner
my-runner
INFO[0034] fcf5c619 Registering runner... succeeded
Please enter the executor: shell, docker, docker-ssh, ssh?
shell
Please enter the Docker image (eg. ruby:2.1):
node:4.5.0
INFO[0037] Runner registered successfully. Feel free to start it, but if it's
running already the config should be automatically reloaded!

4、配置可在/etc/gitlab-runner/config.toml中修改

配置.gitlab-ci.yml文件

cache:
  key: ${CI_BUILD_REF_NAME}
  paths:

release:
  script:
    - qshell account UNvLhAbSMs4RRxjEbleBRmcq_0D KhuaiYb5igyedy8WAl1gzm-A_WF
    - qshell qupload 5 qupload.json
  only:
    - master
  stage: build
  tags:
    - server

七牛的cli工具: qupload
wget http://devtools.qiniu.com/qshell-v2.0.2.zip
unzip qshell-v2.0.2.zip
复制到/usr/local/bin下并改名为qshell
命令
1、qshell account ak apsw
2、qshell qupload 5(并发数) qupload.json

qupload.json
{
   "src_dir"            :   "./",
   "bucket"             :   "feng",
   "key_prefix"         :   "cdn/",
   "overwrite"          :   true,
   "rescan_local"       :   true,
   "skip_path_prefixes" :   "node_modules/,qupload.json",
   "skip_fixed_strings" :   ".svn,.git,.gitignore,.gitlab-ci.yml,.vscode-upload.json",
   "skip_suffixes"      :   ".DS_Store,.exe,.log",
   "log_file"           :   "upload.log",
   "log_level"          :   "error",
   "log_rotate"         :   1,
   "log_stdout"         :   true,
   "file_type"          :   0
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容