简体   繁体   中英

How to push git project with Jenkins to another server?

I was thinking I'll try out Jenkins since it looks a rather nice continous integration environment for our gitolite projects. However I don't know a few things.

Setup:

  • 1 Gitolite server
  • 2 Staging servers
  • Multiple production servers
  • Multiple developer computers

Goal: I wish Jenkins would check a repository when someone pushes into it, if the latest push does something bad to the whole project (laravel website basically). After that, check if the push was made for developement branch, then pull it to the corresponding staging server. However, if it was pushed into the master, then pull it to the production server.

Question #1 : Is it possible to trigger a git pull command with Jenkins to another server? If yes, then how?

Question #2 : How can I check the commit with Jenkins if it is broken?

Question #3 : Which server should I install Jenkins to? I was thinking of using a docker. Locally it is running like a charm.

Question #4 : Is it possible to import all the repositories to individual projects from the git server automatically or I have to do that manually one-by-one?

have a look at https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

In each Jenkins-Project you can configure via this Jenkins-Plugin a git-repository to become cloned by jenkins.

Question #1: Is it possible to trigger a git pull command with Jenkins to another server? If yes, then how?

If you start a build-process, than Jenkins pulls the repository first.

Question #2: How can I check the commit with Jenkins if it is broken?

I don't understand what you mean.

Question #3: Which server should I install Jenkins to? I was thinking of using a docker. Locally it is running like a charm.

Well, I use a Jenkins on an ubuntu lts (without docker)

Question #4: Is it possible to import all the repositories to individual projects from the git server automatically or I have to do that manually one-by-one?

This does not make sence to me. If you want in the workspace of one ie freestyle Jenkins Project multiple git-repositorys, than at the project level the Git Plugin has to be configured by selecting the Git option at the Source Code Management section multible times.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM