Configure Jenkins Notes

Source: Internet
Author: User
Tags ssh server port git clone ansible playbook
Install Jenkins Installing JDK
Yum-y Install java-1.8.0-openjdk*
java-version

Configure Java_home

JAVA_HOME=/USR/LIB/JVM/JAVA-1.8.0-OPENJDK
path= $JAVA _home/bin: $PATH
classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
export java_home
export PATH
export CLASSPATH

Save the appeal configuration to/etc/profile, and then source/etc/profile it into effect. Install Jenkins

# Add Jenkins software source
wget-o/etc/yum.repos.d/jenkins.repo Http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm-- Import Http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
# Install Jenkins
Yum install Jenkins
# Configure boot
chkconfig Jenkins on
# start Jenkins
Service Jenkins start

This is where the Jenkins ver.2.100 version is installed, and then the ip:8080 is opened in the browser, which is initialized with the prompts. Install maven

Yum Install Mvn-y
Install git
Yum Install Git-y
Install ansible
Yum Update
yum install python-pip
pip install ansible
Configure Ansible Playbook
Mkdir-p/opt/ansible
cd/opt/ansible
git clone https://github.com/hengyunabc/jenkins-ansible-supervisor-deploy
Configuring the parameterized build process
App    to release the name of the app
Http_port     Tomcat's HTTP port
https_port  Tomcat's HTTPS port
server_port Tomcat's server port
java_opts    Tomcat-initiated JAVA parameters
deploy_path   Tomcat directory
target_host
directory of which machine War_path       Jenkins generated war package to publish to
Configure Ansible-playbook-host

Once configured, you can use Target_host to specify the published server.

Vim/opt/ansible/jenkins-ansible-supervisor-deploy/hosts

Edit the format as follows

[Project]
10.252.250.80  ansible_ssh_user=www  Ansible_ssh_private_key_file=/var/lib/jenkins/usersecrets/id_rsa

Ansible_ssh_user is the user name of the landing server, Ansible_ssh_private_key_file is the private key to the target server. If the target server is logged in using a password, use Ansible_ssh_pass. ansible connect test with SSH after installation

Ansible after installation use SSH for connection Test reference article

How-to-install-and-configure-jenkins-on-centos-6-4

Step by step using Jenkins,ansible,supervisor to build a Web build publishing system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.