cicd for kubernetes and jenkins
npm install vcicd-cli``shellinstall
yarn global add vcicd-cli
cicd --help
----
Usage: cicd [options] [command]
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
app 为应用接入CI/CD流水线
config 用户信息、CI/CD相关配置
login [options] 用户登录: 初始化cicd命令行工具
help [command] display help for command
cicd app --help
----
Usage: cicd app [options] [command]
为应用接入CI/CD流水线
Options:
-h, --help display help for command
Commands:
init [options] 🔥为应用配置CI流程, 请务必进入应用根目录,再执行此命令
deploy [options] 🔥为应用配置CD流程, 请务必进入k8s-vela-config根目录(非master分支), 再执行此命令
jenkins 🚫单独为应用创建Jenkins多分支流水线任务, 并添加Jenkins webhook到GitLab仓库
hook [options] 🚫单独添加[Jenkins|GitLab机器人|CICD机器人]的webhook到GitLab仓库
script [options] 🚫单独为应用生成CI脚本
mr 🚀快速提交MergeRequest到k8s-vela-config仓库
help [command] display help for command
`
shell
示例
vi ~/.zshrc
export GITLAB_URL="http://xxxx"
export GITLAB_PRIVATE_TOKEN="xxx"source ~/.zshrc
`使用帮助
`shel
安装工具
brew install node
brew install yarn
yarn global add vcicd-cli
``shel
升级工具版本
yarn global add vcicd-cli
``shel
查看工具版本
cicd --version
``shel
登录CICD
cicd login
``shel
自动创建Jenkins任务、绑定Webhook、生成CI配置文件
进入项目根目录
cicd init
``shel
生成CD部署清单 (工具版本 >= 1.0.0)
进入k8s-vela-config根目录(非master分支)
cicd deploy
`单独使用某项功能
`shel
自动创建Jenkins任务
进入项目根目录
cicd jenkins
``shel
为Gitlab项目绑定Webhook
进入项目根目录
cicd hook --gitlab --jenkins --cicd
``shel
生成CI配置文件
进入项目根目录
cicd script
``