Difference between revisions of "Building Zimbra using Git"

(General Information)
m
 
(39 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{BC|Certified}}
 +
__FORCETOC__
 +
<div class="col-md-12 ibox-content">
 +
= Building Zimbra using Git =
 +
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|}}
 +
 
==General Information==
 
==General Information==
 
The git fusion server gives users access to download and build/modify Zimbra source code for Open Source products. Building Zimbra Collaboration Suite from Zimbra's git fusion server requires advanced knowledge of troubleshooting. It is not available for Network Edition components. Changes cannot be committed to the git fusion server.
 
The git fusion server gives users access to download and build/modify Zimbra source code for Open Source products. Building Zimbra Collaboration Suite from Zimbra's git fusion server requires advanced knowledge of troubleshooting. It is not available for Network Edition components. Changes cannot be committed to the git fusion server.
Line 4: Line 10:
 
By building Zimbra, you agree to Zimbra's licensing terms. Building from source is not covered under the [http://www.zimbra.com/license/zimbra_public_eula.html ZEUL], unlike pre-compiled binaries, but rather the Open Source licenses as descrived on the [http://www.zimbra.com/license/ licensing] page.  Please read the page on [http://www.zimbra.com/community/contribute.html contributing] if you plan to submit back any patches.
 
By building Zimbra, you agree to Zimbra's licensing terms. Building from source is not covered under the [http://www.zimbra.com/license/zimbra_public_eula.html ZEUL], unlike pre-compiled binaries, but rather the Open Source licenses as descrived on the [http://www.zimbra.com/license/ licensing] page.  Please read the page on [http://www.zimbra.com/community/contribute.html contributing] if you plan to submit back any patches.
  
Technical support for source building can be found in the [http://www.zimbra.com/forums/developers/ Zimbra Developers forum].
+
Technical support for source building can be found in the [https://community.zimbra.com/collaboration/f/1885 Zimbra Developers community].
  
By default, you will only be able to build "out of the box" with supported operating systems (see list on [http://www.zimbra.com/community/downloads.html site] or files in ZimbraBuild/defs). However, you may be able to modify the source to get Zimbra to build on your OS of choice.
+
By default, you will only be able to build "out of the box" with supported operating systems (see list on [http://www.zimbra.com/downloads/zimbra-collaboration-open-source site] or files in ZimbraBuild/defs). However, you may be able to modify the source to get Zimbra to build on your OS of choice.
  
 
==Initial Setup==
 
==Initial Setup==
 
At it's simplest, to obtain the source you need to essentially:
 
At it's simplest, to obtain the source you need to essentially:
 +
* Install git
 +
** <tt>yum install git</tt> (RHEL, SLES, etc)
 +
** <tt>apt-get install git</tt> (Ubuntu, etc)
 +
==ZCS 8.7.6 and above==
 +
Starting ZCS 8.7.6 and above we have moved all our repositories to our public GitHub, so we have changed the way you can download, review and of course build the product, you can find all the details here:
 +
* [https://github.com/Zimbra/zm-build https://github.com/Zimbra/zm-build]
 +
 +
 +
==ZCS 8.7.2 to 8.7.5==
 +
=== Accessing git using ssh ===
 +
* Obtain the git ssh access keys.
 +
mkdir -p /tmp/zimbra-git1
 +
cd /tmp/zimbra-git1
 +
wget https://files.zimbra.com/downloads/git-fusion/zimbra-git1-ssh.tgz
 +
tar xfz zimbra-git1-ssh.tgz
 +
 +
* Add the access keys to your own user account:
 +
cd ~/.ssh
 +
cp /tmp/zimbra-git1/id_rsa_git1* .
 +
 +
* Add the following ~/.ssh/config.  Create the file if it doesn't exist:
 +
Host zimbra-git1
 +
  User public
 +
  Hostname git.zimbra.com
 +
  IdentityFile ~/.ssh/id_rsa_git1
 +
  IdentitiesOnly yes
 +
  Port 1067
 +
 +
* Ensure the permissions on the config file are correct
 +
chmod 600 ~/.ssh/config
 +
chmod 600 ~/.ssh/id_rsa_git1
 +
 +
* List of all repos available:
 +
https://git.zimbra.com/repos/zimbra-foss-ge872/
 +
 +
=== Obtaining the source to Zimbra Collaboration Suite ===
 +
The source code for ZCS is retrieved from git.zimbra.com as described above.
 +
 +
To obtain the source:
 +
mkdir -p ~/git
 +
cd ~/git
 +
 +
=== Cloning using SSH.  Requires SSH access keys above ===
 +
You will need to clone one by one, or make an script for it, you can find the list here: https://git.zimbra.com/repos/zimbra-foss-ge872/
 +
git clone git@zimbra-git1:zm-zcs
 +
git clone git@zimbra-git1:zm-store
 +
git clone git@zimbra-git1:zm-common
 +
git clone git@zimbra-git1:zm-client
 +
git clone git@zimbra-git1:zm-soap
 +
etc
 +
 +
'''Note: Code is just published as it is. Objective is people should able to see the code changes.
 +
There are some tweaks required to get it build.  We are working on restructuring.'''
  
* Install git
+
==ZCS 8.7.1 and below==
** yum install git (RHEL, SLES, etc)
+
=== Accessing git using ssh ===
** aptitude install git (Ubuntu, etc)
+
* Obtain the git ssh access keys.
* Obtain the git ssh access keys
+
mkdir -p /tmp/zimbra-git
** mkdir -p /tmp/zimbra-git
+
cd /tmp/zimbra-git
** cd /tmp/zimbra-git
+
wget https://files.zimbra.com/downloads/git-fusion/zimbra-git-ssh.tgz
** wget http://files2.zimbra.com/downloads/git-fusion/zimbra-git-ssh.tgz
+
tar xfz zimbra-git*
** tar xfz zimbra-git-ssh.tgz
 
  
 
* Add the access keys to your own user account:
 
* Add the access keys to your own user account:
** cd ~/.ssh
+
cd ~/.ssh
** cp /tmp/zimbra-git/id_rsa_git* .
+
cp /tmp/zimbra-git/id_rsa_git* .
  
 
* Add the following ~/.ssh/config.  Create the file if it doesn't exist:
 
* Add the following ~/.ssh/config.  Create the file if it doesn't exist:
  <nowiki>
+
  Host zimbra-git
Host zimbra-git
+
  User public
  User public
+
  Hostname git.zimbra.com
  Hostname git.zimbra.com
+
  IdentityFile ~/.ssh/id_rsa_git
  IdentityFile ~/.ssh/id_rsa_git
+
  IdentitiesOnly yes
  IdentitiesOnly yes
+
  Port 1067
  Port 1067
 
</nowiki>
 
'''IMPORANT''': Before attempting to build, please be sure to read the README for the branch release you're building.
 
  
 +
* Ensure the permissions on the config file are correct
 +
chmod 600 ~/.ssh/config
 +
chmod 600 ~/.ssh/id_rsa_git
  
--
+
=== Obtaining the source to Zimbra Collaboration Suite ===
 +
The source code for ZCS is retrieved from git.zimbra.com as described above.
  
New master script for (5.0.14+):
+
To obtain the source:
  ~/git/REPOSITORY/ZimbraBuild/buildZCS.sh -t
+
  mkdir -p ~/git
(This will help you through adding Ant & JDK, check dependencies, build ThridParty using a public CPAN mirror for Perl, then start the ZCS build process.)
+
cd ~/git
  
'''IMPORTANT: NOT YET UPDATED FOR GIT'''
+
=== Cloning using SSH.  Requires SSH access keys above ===
 +
git clone git@zimbra-git:zimbra-foss
  
== Obtaining the source to Zimbra Collaboration Suite ==
+
=== Cloning using anonymous HTTPS ===
The source code for ZCS is retrieved from git.zimbra.com.
+
'''For ZCS 8.7.1 and below repos'''
 +
git clone https://git.zimbra.com/repos/zimbra-foss/.git
  
 
===Source for the "main" branch===
 
===Source for the "main" branch===
main is the development branch.
+
* main is the development branch.
The primary git respository for main is: '''main-foss'''
 
  
To obtain the source:
+
The 'main' branch, (often referred to as mainline) contains the latest code - if your interested in seeing pre-release software check it out.
* mkdir -p ~/git
+
 
* cd ~/git
+
It is constantly in flux (for instance we might stagger spec files to avoid the need to always rebuild ThirdParty), if you're hitting a error in the Zimbra build side the first thing to do is re-sync, as we typically resolve these fast.
* git clone git@zimbra-git:main-foss
+
 
 +
It is the default branch in use after doing a checkout of '''zimbra-foss'''
 +
 
 +
=== Listing available branches ===
 +
The '''zimbra-foss''' repo contains all the available release branches.  You can obtain a list of the branches via:
 +
git branch -a
  
===Source for the IronMaiden "8.0" branch===
+
Example output (abbreviated)
  IronMaiden is the 8.0 series release.  Current version & changelist can be found on [http://pm.zimbra.com/pm_release.php?rel=8.0 Pmweb]
+
  * main-foss
The primary git respository for IRONMAIDEN development is: '''ironmaiden-foss'''
+
  remotes/origin/HEAD -> origin/main-foss
The current release repository is '''ironmaiden-806-foss'''
+
  remotes/origin/frank-foss
 +
  remotes/origin/franklin-5010-foss
 +
  remotes/origin/franklin-5011-foss
 +
  remotes/origin/franklin-5012-foss
 +
  remotes/origin/franklin-5013-foss
 +
  remotes/origin/franklin-5014-foss
 +
  remotes/origin/franklin-5015-foss
 +
  remotes/origin/franklin-5016-foss
 +
  remotes/origin/franklin-5017-foss
 +
  remotes/origin/franklin-5018-foss
 +
  remotes/origin/franklin-5019-foss
 +
  remotes/origin/franklin-5020-foss
  
To obtain the source:
+
The branch with a '''*''' in front of it is your active checkout.
* mkdir -p ~/git
 
* cd ~/git
 
* git clone git@zimbra-git:REPOSITORY  Example:
 
** git clone git@zimbra-git:ironmaiden-foss
 
  
===Source for the Helix "7.x" branch===
+
=== Changing the active checkout ===
Helix is the 7.0, 7.1, and 7.2 series release.  Current version & changelist can be found on [http://pm.zimbra.com/pm_release.php?rel=7.0 Pmweb]
+
To change the active branch, you use the '''git checkout''' command, and supply the release you are interested in.
The primary git respository for HELIX development is: '''helix-foss'''.
 
The current release repository is '''helix-726-foss'''
 
  
To obtain the source:
+
For example, to switch to the IRONMAIDEN 8.0.7 release branch, one would execute:
* mkdir -p ~/git
+
  git checkout ironmaiden-807-foss
* cd ~/git
 
* git clone git@zimbra-git:REPOSITORY Example:
 
** git clone git@zimbra-git:helix-foss
 
  
===Updating an existing source clone===
+
===Updating an existing clone===
 
To update an already existing clone:
 
To update an already existing clone:
* cd ~/git/REPOSITORY
+
cd ~/git/zimbra-foss
* git pull
+
git pull
==Building Zimbra Desktop==
+
 
[[Building Zimbra Desktop on Linux]]
+
===Building Zimbra Collaboration Server===
 +
To build Zimbra Collaboration Server, the "buildZCS.sh" script can be used, that is located in the ZimbraBuild directory after the checkout completes.
 +
 
 +
The first time you go to build, it is recommended to execute
 +
cd ~/git/zimbra-foss/ZimbraBuild
 +
 
 +
==== ZCS 8.6 and prior ====
 +
./buildZCS.sh -t -u
 +
 
 +
This will help you through adding Ant & JDK, check dependencies, build ThridParty using a public CPAN mirror for Perl, then start the ZCS build process.  It requires sudo access to install the various required binaries and libraries for build (The -u option).
 +
 
 +
This will help you through adding Ant & the required Java JDK.  It is no longer necessary to build Third Party to build ZCS with 8.7 and later.
 +
 
 +
For 8.6 and previous, if the server already has the various required binaries and libraries installed, then:
 +
cd ~/git/zimbra-foss/ZimbraBuild
 +
./buildZCS.sh -t
  
[[Building Zimbra Desktop on Windows (win32)]]
+
Can be used to just build out Third Party and ZCS.
  
[[Building Zimbra Desktop on Macintosh (OS 10.4.6+)]]
+
If Third Party has already been built, and simply rebuilding ZCS is desired, this can be achieved with:
 +
cd ~/git/zimbra-foss/ZimbraBuild
 +
./buildZCS.sh
  
==Buiding Zimbra Mobile Edition==
 
ZME (J2ME) Client: [[Building ZimbraME]]
 
  
==Building "Nightlies"==
+
=== ZCS 8.7 and 8.7.1 ===
The 'main' branch, (often referred to as mainline) contains the latest code - if your interested in seeing pre-release software check it out.
+
./buildZCS.sh
  
It is constantly in flux (for instance we might stagger spec files to avoid the need to always rebuild ThirdParty), if you're hitting a error in the Zimbra build side the first thing to do is re-sync, as we typically resolve these fast.
+
This will help you through adding Ant & JDK.  Note that JAVA_HOME will need to be set correctly to the location of the JDK.
  
Under Construction:
+
==== Third party packages ====
 +
If working on adding recognition for a new OS, it will be necessary to build out a related 3rd party package repository.  The overall build process is located on github, and there is a vagrant profile also noted on github for helping with the process.  More documentation will be provided soon, as the github migration is still underway.
  
Building nightlies README
+
Relevant URLs:
 +
* https://github.com/Zimbra/packages
 +
* https://github.com/Zimbra/zimbra-build
 +
* https://github.com/Zimbra/vagrant-provision-zimbra
  
==Troubleshooting==
+
==Building with Maven==
Search the forums for any recent reports or create a new thread letting us know and we'll get right on it.
+
Starting with ZCS 9.0/KISS the Java projects are built using Maven.  
  
 +
See [[Building Zimbra with Maven]] for more details.
  
Third Party Component Failures |
+
==Building Zimbra Desktop==
Perl Components fail to build
+
* [[Building Zimbra Desktop on Linux]]
[[configure: error: User zimbra (and/or group zimbra) doesn't exist.]]
+
* [[Building Zimbra Desktop on Windows (win32)]]
 +
* [[Building Zimbra Desktop on Macintosh (OS 10.4.6+)]]
  
 +
==Troubleshooting==
 +
Search the forums for any recent reports or create a new thread letting us know and we'll get right on it.
  
 +
==Contributions==
 +
See https://www.zimbra.com/open-source/contribute
  
{{Article Footer|unknown|1/29/2014}}
+
{{Article Footer|unknown|7/7/2014}}
  
 
[[Category: Build]]
 
[[Category: Build]]

Latest revision as of 17:28, 18 January 2018

Building Zimbra using Git

   KB 20746        Last updated on 2018-01-18  




0.00
(0 votes)

General Information

The git fusion server gives users access to download and build/modify Zimbra source code for Open Source products. Building Zimbra Collaboration Suite from Zimbra's git fusion server requires advanced knowledge of troubleshooting. It is not available for Network Edition components. Changes cannot be committed to the git fusion server.

By building Zimbra, you agree to Zimbra's licensing terms. Building from source is not covered under the ZEUL, unlike pre-compiled binaries, but rather the Open Source licenses as descrived on the licensing page. Please read the page on contributing if you plan to submit back any patches.

Technical support for source building can be found in the Zimbra Developers community.

By default, you will only be able to build "out of the box" with supported operating systems (see list on site or files in ZimbraBuild/defs). However, you may be able to modify the source to get Zimbra to build on your OS of choice.

Initial Setup

At it's simplest, to obtain the source you need to essentially:

  • Install git
    • yum install git (RHEL, SLES, etc)
    • apt-get install git (Ubuntu, etc)

ZCS 8.7.6 and above

Starting ZCS 8.7.6 and above we have moved all our repositories to our public GitHub, so we have changed the way you can download, review and of course build the product, you can find all the details here:


ZCS 8.7.2 to 8.7.5

Accessing git using ssh

  • Obtain the git ssh access keys.
mkdir -p /tmp/zimbra-git1
cd /tmp/zimbra-git1
wget https://files.zimbra.com/downloads/git-fusion/zimbra-git1-ssh.tgz
tar xfz zimbra-git1-ssh.tgz
  • Add the access keys to your own user account:
cd ~/.ssh
cp /tmp/zimbra-git1/id_rsa_git1* .
  • Add the following ~/.ssh/config. Create the file if it doesn't exist:
Host zimbra-git1
  User public
  Hostname git.zimbra.com
  IdentityFile ~/.ssh/id_rsa_git1
  IdentitiesOnly yes
  Port 1067
  • Ensure the permissions on the config file are correct
chmod 600 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa_git1
  • List of all repos available:

https://git.zimbra.com/repos/zimbra-foss-ge872/

Obtaining the source to Zimbra Collaboration Suite

The source code for ZCS is retrieved from git.zimbra.com as described above.

To obtain the source:

mkdir -p ~/git
cd ~/git

Cloning using SSH. Requires SSH access keys above

You will need to clone one by one, or make an script for it, you can find the list here: https://git.zimbra.com/repos/zimbra-foss-ge872/

git clone git@zimbra-git1:zm-zcs
git clone git@zimbra-git1:zm-store
git clone git@zimbra-git1:zm-common
git clone git@zimbra-git1:zm-client
git clone git@zimbra-git1:zm-soap

etc

Note: Code is just published as it is. Objective is people should able to see the code changes. There are some tweaks required to get it build. We are working on restructuring.

ZCS 8.7.1 and below

Accessing git using ssh

  • Obtain the git ssh access keys.
mkdir -p /tmp/zimbra-git
cd /tmp/zimbra-git
wget https://files.zimbra.com/downloads/git-fusion/zimbra-git-ssh.tgz
tar xfz zimbra-git*
  • Add the access keys to your own user account:
cd ~/.ssh
cp /tmp/zimbra-git/id_rsa_git* .
  • Add the following ~/.ssh/config. Create the file if it doesn't exist:
Host zimbra-git
  User public
  Hostname git.zimbra.com
  IdentityFile ~/.ssh/id_rsa_git
  IdentitiesOnly yes
  Port 1067
  • Ensure the permissions on the config file are correct
chmod 600 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa_git

Obtaining the source to Zimbra Collaboration Suite

The source code for ZCS is retrieved from git.zimbra.com as described above.

To obtain the source:

mkdir -p ~/git
cd ~/git

Cloning using SSH. Requires SSH access keys above

git clone git@zimbra-git:zimbra-foss

Cloning using anonymous HTTPS

For ZCS 8.7.1 and below repos

git clone https://git.zimbra.com/repos/zimbra-foss/.git

Source for the "main" branch

  • main is the development branch.

The 'main' branch, (often referred to as mainline) contains the latest code - if your interested in seeing pre-release software check it out.

It is constantly in flux (for instance we might stagger spec files to avoid the need to always rebuild ThirdParty), if you're hitting a error in the Zimbra build side the first thing to do is re-sync, as we typically resolve these fast.

It is the default branch in use after doing a checkout of zimbra-foss

Listing available branches

The zimbra-foss repo contains all the available release branches. You can obtain a list of the branches via:

git branch -a

Example output (abbreviated)

* main-foss
  remotes/origin/HEAD -> origin/main-foss
  remotes/origin/frank-foss
  remotes/origin/franklin-5010-foss
  remotes/origin/franklin-5011-foss
  remotes/origin/franklin-5012-foss
  remotes/origin/franklin-5013-foss
  remotes/origin/franklin-5014-foss
  remotes/origin/franklin-5015-foss
  remotes/origin/franklin-5016-foss
  remotes/origin/franklin-5017-foss
  remotes/origin/franklin-5018-foss
  remotes/origin/franklin-5019-foss
  remotes/origin/franklin-5020-foss

The branch with a * in front of it is your active checkout.

Changing the active checkout

To change the active branch, you use the git checkout command, and supply the release you are interested in.

For example, to switch to the IRONMAIDEN 8.0.7 release branch, one would execute:

git checkout ironmaiden-807-foss

Updating an existing clone

To update an already existing clone:

cd ~/git/zimbra-foss
git pull

Building Zimbra Collaboration Server

To build Zimbra Collaboration Server, the "buildZCS.sh" script can be used, that is located in the ZimbraBuild directory after the checkout completes.

The first time you go to build, it is recommended to execute

cd ~/git/zimbra-foss/ZimbraBuild

ZCS 8.6 and prior

./buildZCS.sh -t -u

This will help you through adding Ant & JDK, check dependencies, build ThridParty using a public CPAN mirror for Perl, then start the ZCS build process. It requires sudo access to install the various required binaries and libraries for build (The -u option).

This will help you through adding Ant & the required Java JDK. It is no longer necessary to build Third Party to build ZCS with 8.7 and later.

For 8.6 and previous, if the server already has the various required binaries and libraries installed, then:

cd ~/git/zimbra-foss/ZimbraBuild
./buildZCS.sh -t

Can be used to just build out Third Party and ZCS.

If Third Party has already been built, and simply rebuilding ZCS is desired, this can be achieved with:

cd ~/git/zimbra-foss/ZimbraBuild
./buildZCS.sh


ZCS 8.7 and 8.7.1

./buildZCS.sh

This will help you through adding Ant & JDK. Note that JAVA_HOME will need to be set correctly to the location of the JDK.

Third party packages

If working on adding recognition for a new OS, it will be necessary to build out a related 3rd party package repository. The overall build process is located on github, and there is a vagrant profile also noted on github for helping with the process. More documentation will be provided soon, as the github migration is still underway.

Relevant URLs:

Building with Maven

Starting with ZCS 9.0/KISS the Java projects are built using Maven.

See Building Zimbra with Maven for more details.

Building Zimbra Desktop

Troubleshooting

Search the forums for any recent reports or create a new thread letting us know and we'll get right on it.

Contributions

See https://www.zimbra.com/open-source/contribute

Verified Against: unknown Date Created: 7/7/2014
Article ID: https://wiki.zimbra.com/index.php?title=Building_Zimbra_using_Git Date Modified: 2018-01-18



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search