Jenkins 项目构建配置

一·、全局工具配置

一、JDK 配置

which java
/usr/local/java/bin/java     ####查看JDK安装路径
 

二、mvnen配置

which maven
/usr/bin/which: no maven in (/data/maven/apache-maven-3.8.6/bin:/usr/local/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/u
sr/bin:/root/bin)

 新建任务

无法连接仓库:Command "git ls-remote -h git@192.168.190.172:root/my_procent_project.git HEAD" returned status code 128: stdout: stderr: Host key verification failed. fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Credentials?

需要在全局凭据中添加jenkins 的私钥  若是没有安装git 需要安装git   

yum -y install git

whereis git

三、git 配置

Git Parameter

这是一个参数构建扩展,可以在构建的时候选择git的某一个分支来构建服务。

在参数化构建步骤当中,可添加Git的branch或者tag来作为参数进行构建

四、插件 Publish over SSH使用

jenkins自动部署,可能存jenkins在服务器A,代码部署在服务器B,这时候会将代码拉到A服务器,在推给B服务器,就需要使用Send build artifacts over SSH 插件

Send build artifacts over SSH插件

这个插件是jenkins连接linux系统的时候使用
插件名:Publish over SSH

查看插件并进行安装

系统配置中找到 SSH Servers
配置 服务器的账号密码,指定路径。

构建

工作区路径:/var/lib/jenkins/workspace/centos_project/traget/
 

Deploy to container Plugin

subversion plugin-in

ssh

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值