配置步骤
-
配置 gitee Manage Jenkins → Security → Manage Credentials 也可以使用 API Token,需要安装 Gitee 插件
-
NodeJS 安装 NodeJS 插件 在 Global Tool Configuration 配置 Node 项目设置 → Build Environment → Provide Node & npm bin/ folder to PATH
-
安装 Publish Over SSH Manage Jenkins → Configure System → Publish over SSH 配置 SSH Server
源码管理
填写 git 地址,http地址。 制定分支,如 */master
构建后操作
- Send build artifacts over SSH
- Source files 如果是拷贝所有文件,写
*
,包括隐藏文件(文件夹)写**
,如dist/**
- Remove prefix
dist
- Remote directory 网站目录,如 com-zaodianying
- Exec command 随意写个shell命令
- 勾选 Verbose output in console
- Source files 如果是拷贝所有文件,写
- Editable Email Notification
- 构建成功发送邮件要写 project from 配合腾讯企业邮箱发件人和账号一致的要求。System Admin e-mail address 要设置一样的邮箱。目前写:web@exyouth.com
- Allow sending to unregistered users ?
jenkins 升级
下载安装包放到 docker/jenkins-1 对应 docker 的 /home 目录 进入 docker 拷贝到 /usr/share/jenkins,记得先备份 docker exec -it -u root [container_id] /bin/bash