The purpose of continuous integration:
Let's update the code every time we commit to git after the warehouse, the new version is automatically built and automatically deployed to the test environment to improve productivity and to say goodbye to repetitive labor
System Environment: CentOS6.5 , JDK SE 1.8.0_60 , Maven3.0.5 , Jenkins2.4.1 , Git (yum install) , Docker , Docker-compose , Gitlab
Maven, JDK, git, install other articles written and skipped again.
MAVEN Installation
JDK Installation
Git install:
Yum-y Install git
Gitlab Installation:
1. If you want to use Postfix to send mail, please select ' Internet Site ' during installation. You can also use Sendmai or configure the SMTP service and use SMTP to send mail.
On Centos 6 and 7 systems, the following command will open the HTTP and SSH ports inside the system firewall.
[[email protected] src]# Yum Install Curl openssh-server openssh-clients postfix cronie[[email protected] src]# service PO Stfix Start[[email protected] src]# chkconfig postfix on[[email protected] src]# lokkit-s http-s SSH
2. Add the Gitlab repository and install it on the server
Curl-ss http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bashsudo yum install Gitlab-ce
3. Start Gitlab
Gitlab-ctl Reconfigure
Gitlab fault and routine maintenance reference
Docker Installation:
Install the source of Docker
wget yum ivh epel-release-latest-6.noarch.rpm RPM-IVH https://dl.fedoraproject.org/pub/epel/ epel-release-latest-6.noarch.rpm Yum Install Docker-io
2. Installing Docker-compose
Curl-l https://github.com/docker/compose/releases/download/1.1.0/docker-compose-' uname-s '-' uname-m ' >/usr/ Local/bin/docker-compose
To install Jenkins:
Wget-o/etc/yum.repos.d/jenkins.repo rpm--importyum Install Jenkins
Configure the ports of Jenkins, etc.:
Sed-i ' s#jenkins_java_cmd= "" #JENKINS_JAVA_CMD = "/usr/local/java/jdk/bin/java" #g '/etc/sysconfig/jenkinssed-i ' s/ jenkins_port= "8080"/jenkins_port= "8009"/g '/etc/sysconfig/jenkinssed-i ' s/jenkins_java_options= "- Djava.awt.headless=true "/jenkins_java_options="-djava.awt.headless=true-duser.timezone=asia/shanghai "/g"/etc/ Sysconfig/jenkins
Start Jenkins:
/etc/init.d/jenkins start
Browser access:
http://192.168.31.123:8009
The first visit prompts for a password, and the password file is:
Cat/var/lib/jenkins/secrets/initialadminpassword
This article is from the "beginner's mind, always" blog, please be sure to keep this source http://gouyc.blog.51cto.com/1594451/1827237
Jenkins Continuous Integration Environment building