centos 搭建jenkins+git+maven

 

 
git+maven+jenkins持续集成搭建
发布人:[李源]  2017-12-08 04:33:37
 

一、搭建说明

系统:centos 6.5 

jdk:1.8.0_144

jenkins:jenkins-2.93-1.1

git:git-2.9.0

maven:Maven 3.3.9

二、部署

2.1、jdk安装

1)下载

需要下载到本地,再传到服务器。

cd  /srv/software

下载地址:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

tar -zxf jdk-8u144-linux-x64.tar.gz -C /srv

mv /srv/jdk1.8.0_144  /srv/JDK

2)配置环境变量

vi  /etc/profile在文尾加入以下行

JAVA_HOME=/srv/JDK

PATH=$JAVA_HOME/bin:$PATH

CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME PATH CLASSPATH

执行命令:

source /etc/profile

2.2、jenkins安装

1)下载

wget -O /etc/yum.repos.d/jenkins.repo http://jenkins-ci.org/redhat/jenkins.repo

rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

2)安装

yum install jenkins

3)配置

将jenkins端口改为7070

修改"/etc/sysconfig/jenkins"文件,以下行:

JENKINS_PORT="7070"

service jenkins start

如果报错:“Starting Jenkins bash: /usr/bin/java:”

解决办法:在“/etc/init.d/jenkin”插入java路径,如下:

candidates=" /srv/JDK/bin/java                  #java路径 

/etc/alternatives/java 

/usr/lib/jvm/java-1.8.0/bin/java 

/usr/lib/jvm/jre-1.8.0/bin/java 

/usr/lib/jvm/java-1.7.0/bin/java 

/usr/lib/jvm/jre-1.7.0/bin/java 

/usr/bin/java 

4)登录jenkins

访问ip://7070

此时初始用户admin需要登录密码,初始密码保存在/var/lib/jenkins/secrets/initialAdminPassword文件中。

登录后,点击安装jenkins插件。

2.3、git安装

1)下载、安装

cd /srv/software

curl --progress https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz | tar xz

cd git-2.9.0

./configure --prefix=/usr/local

make && make install

git --version输出版本信息,说明安装成功。

2.4、maven安装

cd /srv/software

wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

tar -zxf apache-maven-3.3.9-bin.tar.gz -C /srv

mv /srv/apache-maven-3.3.9 /srv/maven

vi /etc/profile

追加以下行:

export MAVEN_HOME=/srv/maven

export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin

source /etc/profile

mvn -v 查看maven是否安装成功。

三、配置

配置jenkins中jdk,git,maven插件

登录jenkins,系统管理-》全局工具配置

1)jdk



2)git





3)maven

四、构建任务

创建构建任务就可以开始构建了

转载于:https://www.cnblogs.com/dswy/p/8709493.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389918.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

638. 大礼包

638. 大礼包 在 LeetCode 商店中, 有 n 件在售的物品。每件物品都有对应的价格。然而,也有一些大礼包,每个大礼包以优惠的价格捆绑销售一组物品。 给你一个整数数组 price 表示物品价格,其中 price[i] 是第 i 件物品的价格。另有…

记录一次spark连接mysql遇到的问题

在使用spark连接mysql的过程中报错了,错误如下 08:51:32.495 [main] ERROR - Error loading factory org.apache.calcite.jdbc.CalciteJdbc41Factory java.lang.NoClassDefFoundError: org/apache/calcite/linq4j/QueryProviderat java.lang.ClassLoader.defineCla…

什么事数据科学_如果您想进入数据科学,则必须知道的7件事

什么事数据科学No way. No freaking way to enter data science any time soon…That is exactly what I thought a year back.没门。 很快就不会出现进入数据科学的怪异方式 ……这正是我一年前的想法。 A little bit about my data science story: I am a complete beginner…

python基础03——数据类型string

1. 字符串介绍 在python中,引号中加了引号的字符都被认为是字符串。 1 namejim 2 address"beijing" 3 msg My name is Jim, I am 22 years old! 那单引号、双引号、多引号有什么区别呢? 1) 单双引号木有任何区别,部分情况 需要考虑…

Java基础-基本数据类型

Java中常见的转义字符: 某些字符前面加上\代表了一些特殊含义: \r :return 表示把光标定位到本行行首. \n :next 表示把光标定位到下一行同样的位置. 单独使用在某些平台上会产生不同的效果.通常这两个一起使用,即:\r\n. 表示换行. \t :tab键,长度上相当于四个或者是八个空格 …

季节性时间序列数据分析_如何指导时间序列数据的探索性数据分析

季节性时间序列数据分析为什么要进行探索性数据分析? (Why Exploratory Data Analysis?) You might have heard that before proceeding with a machine learning problem it is good to do en end-to-end analysis of the data by carrying a proper exploratory …

TortoiseGit上传项目到GitHub

1. 简介 gitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名gitHub。 2. 准备 2.1 安装git:https://git-scm.com/downloads。无脑安装 2.2 安装TortoiseGit(小乌龟):https://torto…

496. 下一个更大元素 I

496. 下一个更大元素 I 给你两个 没有重复元素 的数组 nums1 和 nums2 ,其中nums1 是 nums2 的子集。 请你找出 nums1 中每个元素在 nums2 中的下一个比其大的值。 nums1 中数字 x 的下一个更大元素是指 x 在 nums2 中对应位置的右边的第一个比 x 大的元素。如果…

利用PHP扩展Taint找出网站的潜在安全漏洞实践

一、背景 笔者从接触计算机后就对网络安全一直比较感兴趣,在做PHP开发后对WEB安全一直比较关注,2016时无意中发现Taint这个扩展,体验之后发现确实好用;不过当时在查询相关资料时候发现关注此扩展的人数并不多;最近因为…

美团骑手检测出虚假定位_在虚假信息活动中检测协调

美团骑手检测出虚假定位Coordination is one of the central features of information operations and disinformation campaigns, which can be defined as concerted efforts to target people with false or misleading information, often with some strategic objective (…

869. 重新排序得到 2 的幂

869. 重新排序得到 2 的幂 给定正整数 N ,我们按任何顺序(包括原始顺序)将数字重新排序,注意其前导数字不能为零。 如果我们可以通过上述方式得到 2 的幂,返回 true;否则,返回 false。 示例 …

org.apache.maven.archiver.MavenArchiver.getManifest

eclipse导入新的maven项目时,pom.xml第一行报错: org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) 解决办法: help -> Install New…

杀进程常用命令

杀进程命令pkill 进程名killall 进程名 # 平缓kill -HUP pid # 平缓kill -USR2 pidkill pid (-9 不要使用)转载于:https://www.cnblogs.com/jmaly/p/9492406.html

CertUtil.exe被利用来下载恶意软件

1、前言 经过国外文章信息,CertUtil.exe下载恶意软件的样本。 2、实现原理 Windows有一个名为CertUtil的内置程序,可用于在Windows中管理证书。使用此程序可以在Windows中安装,备份,删除,管理和执行与证书和证书存储相…

335. 路径交叉

335. 路径交叉 给你一个整数数组 distance 。 从 X-Y 平面上的点 (0,0) 开始,先向北移动 distance[0] 米,然后向西移动 distance[1] 米,向南移动 distance[2] 米,向东移动 distance[3] 米,持续移动。也就是说&#x…

回归分析假设_回归分析假设的最简单指南

回归分析假设The Linear Regression is the simplest non-trivial relationship. The biggest mistake one can make is to perform a regression analysis that violates one of its assumptions! So, it is important to consider these assumptions before applying regress…

Spring Aop之Advisor解析

2019独角兽企业重金招聘Python工程师标准>>> 在上文Spring Aop之Target Source详解中,我们讲解了Spring是如何通过封装Target Source来达到对最终获取的目标bean进行封装的目的。其中我们讲解到,Spring Aop对目标bean进行代理是通过Annotatio…

react事件处理函数中绑定this的bind()函数

问题引入 import React, { Component } from react; import {Text,View } from react-native;export default class App extends Component<Props> {constructor(props){super(props)this.state{times:0}this.timePlusthis.timePlus.bind(this);}timePlus(){let timethis…

301. 删除无效的括号

301. 删除无效的括号 给你一个由若干括号和字母组成的字符串 s &#xff0c;删除最小数量的无效括号&#xff0c;使得输入的字符串有效。 返回所有可能的结果。答案可以按 任意顺序 返回。 示例 1&#xff1a; 输入&#xff1a;s “()())()” 输出&#xff1a;["(())…

为什么随机性是信息

用位思考 (Thinking in terms of Bits) Imagine you want to send outcomes of 3 coin flips to your friends house. Your friend knows that you want to send him those messages but all he can do is get the answer of Yes/No questions arranged by him. Lets assume th…