004-Jenkins-Create FreeStyle Job
0. Environment is CentOS7
yum update
0.1. wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
0.2. rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
0.3. yum –y install jenkins
0.4. yum install java-1.7.0-openjdk(or download from java website manually)
0.5. service jenkins start/stop/restart or systemctl start/stop/restart jenkins
0.6. chkconfig jenkins on
0.7. useradd jenkins; passwd jenkins; su jenkins; ssh-keygen -t rsa -C “XXX”
0.8. copy the content in the id_rsa.pub to the git SSH key
1. Create a Freestyle project
1.1 Enter Jenkins -> New Item, then input the item name and select “Freestyle project”, go to next step;
1.2 Input the Project Name

Source Code Management, we select “Git”

The private key is Enter directly:

Another way to set the credential.
1.3 Go to “Build”
Execute shell
Command:

1.4 Save the job, then you can go the left menu and click "Build Now".
浙公网安备 33010602011771号