装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
}