首先得安装jdk以及Java环境
Jenkins( windows 和 linux )版本下载路径: https://share.weiyun.com/5I3JtHq
安装jdk: yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
安装Jenkins: rpm -ivh jekins-2.32.3-1.1.noarch.rpm
启动: service jenkins start 出现这个说明成功了 Starting jenkins (via systemctl): [ OK ]
端口号设置: netstat -tunlp |grep :8080 不过最好不要用8080因为那样容易与其他端口号冲突导致最后Jenkins不能正常运行
java环境中进入 vi /etc/init.d/jenkins 添加:
# Search usable Java. We do this because various reports indicated
# that /usr/bin/java may not always point to Java >= 1.6
# see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
candidates="
/usr/java/jdk1.7.0_79/bin/java
/etc/alternatives/java/usr/lib/jvm/java-1.6.0/bin/java/usr/lib/jvm/jre-1.6.0/bin/java/usr/lib/jvm/java-1.7.0/bin/java/usr/lib/jvm/jre-1.7.0/bin/java/usr/lib/jvm/java-1.8.0/bin/java/usr/lib/jvm/jre-1.8.0/bin/java/usr/bin/java"for candidate in $candidatesdo [ -x "$JENKINS_JAVA_CMD" ] && break JENKINS_JAVA_CMD="$candidate"doneJAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
端口也可以: vim /etc/sysconfig/jenkins
然后根据ip进行登录后面跟个端口号,也就是刚刚设置得端口号,端口号最好进入vi去编辑那样可以编辑默认的
登录的时候系统提示输入初始密码: cat /var/lib/jenkins/secrets/initiaAdminPassword 进入查看然后copy一下就好了
上面的就是进行Jenkins的搭建,然后就是紧接着Jenkins的插件以及配置了
当插件安装不上的时候,可以直接去网上下载进行安装下载地址:http://updates.jenkins-ci.org/
解压备份plugin.tar.gz
mv plugins /var/lib/jenkins
chown -R Jenkins.jenkins plugins/
service jenkins restart
jenkins的目录介绍:
1 2 3 4 5 6 7 8 9 10 |
|