• Stars
    star
    174
  • Rank 219,104 (Top 5 %)
  • Language
    Perl
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

zm-build for Zimbra Collaboration Suite, FOSS Edition

zm-build

Introduction

This repository contains the build script and supporting files required to create a FOSS build of the Zimbra Collaboration Suite.

Overview

  • build.pl - Invoke this script to produce a build. See the Building section below for an example.
  • instructions/
    • FOSS_remote_list.pl - Maps between remote label and URL
    • FOSS_repo_list.pl - Specifies which branches (or tags) are checked out to build each component repository.
    • FOSS_staging_list.pl - defines the staging order and details.

Setup with Zimbra Development Images (used for building)

  • Set up docker on your box

  • You can then pull and run using development images (built from Zimbra/zm-base-os.git)

  • In case you need to customize the images for your purposes, you could maintain your own Dockerfile such as this:

      $ cat Dockerfile
      FROM zimbra/zm-base-os:devcore-ubuntu-16.04
      RUN sudo apt-get install emacs my-special-tool etc..
      RUN ...
    
      $ docker build -t myuser/my-devcore-ubuntu-16 .
      $ docker run -it myuser/my-devcore-ubuntu-16 bash
    

Ubuntu 16.04

docker run -it zimbra/zm-base-os:devcore-ubuntu-16.04 bash

Ubuntu 14.04

docker run -it zimbra/zm-base-os:devcore-ubuntu-14.04 bash

Ubuntu 12.04

docker run -it zimbra/zm-base-os:devcore-ubuntu-12.04 bash

CentOS 7

docker run -it zimbra/zm-base-os:devcore-centos-7 bash

CentOS 6

docker run -it zimbra/zm-base-os:devcore-centos-6 bash

# some tools are installed inside /home/build/.zm-dev-tools/, zm-build automatically sources this path.

Setup (traditional)

Ubuntu 16.04

The following steps assume that your are starting with a clean VM and are logged in as a non-root user with sudo privileges.

sudo apt-get update
sudo apt-get install software-properties-common openjdk-8-jdk ant ant-optional ant-contrib ruby git maven build-essential debhelper

Ubuntu 14.04

The following steps assume that your are starting with a clean VM and are logged in as a non-root user with sudo privileges.

sudo apt-get install software-properties-common 
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo update-ca-certificates -f
sudo apt-get install openjdk-8-jdk ant ant-optional ant-contrib ruby git maven build-essential

Ubuntu 12.04

sudo apt-get install python-software-properties software-properties-common
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo update-ca-certificates -f
sudo apt-get install openjdk-8-jdk ant ant-optional ant-contrib ruby git maven build-essential zlib1g-dev

CentOS 7

sudo yum groupinstall 'Development Tools'
sudo yum install java-1.8.0-openjdk ant ant-junit ruby git maven cpan wget perl-IPC-Cmd

CentOS 6

sudo yum groupinstall 'Development Tools'
sudo yum remove java-1.7.0-openjdk java-1.6.0-openjdk ant
sudo yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel ruby git cpan wget
# install specific perl modules
sudo cpan IPC::Cmd
cd /tmp
# install maven
wget http://mirror.metrocast.net/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
sudo tar -xf apache-maven-3.3.9-bin.tar.gz
sudo mv apache-maven-3.3.9 /opt
echo 'export PATH="/opt/apache-maven-3.3.9/bin:$PATH"' | sudo tee -a /etc/profile.d/maven.sh
# install current version of ant
wget https://www.apache.org/dist/ant/binaries/apache-ant-1.9.9-bin.zip
sudo unzip apache-ant-1.9.9-bin.zip
sudo mv apache-ant-1.9.9 /opt
echo 'export PATH="/opt/apache-ant-1.9.9/bin:$PATH"' | sudo tee -a /etc/profile.d/ant.sh

Building

Create a directory for your build and check-out the zm-build repository:

mkdir installer-build
cd installer-build
git clone https://github.com/Zimbra/zm-build.git
cd zm-build
git checkout origin/develop

To build a specific patch example 9.0.0.p25 run the following:

mkdir installer-build
cd installer-build
git clone --depth 1 --branch 9.0.0.p25 [email protected]:Zimbra/zm-build.git
cd zm-build
ENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=9.0.0.p25,9.0.0.p24.1,9.0.0.p24,9.0.0.p23,9.0.0.p22,9.0.0.p21,9.0.0.p20,9.0.0.p19,9.0.0.p18,9.0.0.p17,9.0.0.p16,9.0.0.p15,9.0.0.p14,9.0.0.p13,9.0.0.p12,9.0.0.p11,9.0.0.p10,9.0.0.p9,9.0.0.p8,9.0.0.p7,9.0.0.p6.1,9.0.0.p6,9.0.0.p5,9.0.0.p4,9.0.0.p3,9.0.0.p2,9.0.0.p1,9.0.0 --build-release-no=9.0.0 --build-type=FOSS --build-release=NIKOLATESLA --build-release-candidate=GA --build-thirdparty-server=files.zimbra.com --build-no=3969 --no-interactive

The build.pl command is used to build the product. Run it with the -h option for help:

Usage: ./build.pl <options>
Supported options:
   --build-no=i
   --build-ts=i
   --build-artifacts-base-dir=s
   --build-sources-base-dir=s
   --build-release=s
   --build-release-no=s
   --build-release-candidate=s
   --build-type=s
   --build-thirdparty-server=s
   --build-prod-flag!
   --build-debug-flag!
   --build-dev-tool-base-dir=s
   --interactive!
   --git-overrides=s%
   --git-default-tag=s
   --git-default-remote=s
   --git-default-branch=s
   --stop-after-checkout!

You can specify all the options on the command-line, as follows:

./build.pl --build-no=1713 --build-ts=`date +'%Y%m%d%H%M%S'` \
  --build-release=JUDASPRIEST --build-release-no=8.7.6 \
  --build-release-candidate=GA --build-type=FOSS \
  --build-thirdparty-server=files.zimbra.com --no-interactive

The completed build will be archived into a *.tgz file that is stored in the appropriate platform and release-specific subdirectory of the BUILDS directory. The above command, run on an Ubuntu 16.04 machine, created the following:

$HOME/installer_build/BUILDS/UBUNTU16_64/JUDASPRIEST-876/20170322153033_FOSS/zm-build/zcs-8.7.6_1713.UBUNTU16_64.20170322153033.tgz

You can also specify any or all of the required options by placing them in a file called config.build. This file should be at the top level of the zm-build directory. For example:

BUILD_NO                    = 1713
BUILD_RELEASE               = JUDASPRIEST
BUILD_RELEASE_NO            = 8.7.6
BUILD_RELEASE_CANDIDATE     = GA
BUILD_TYPE                  = FOSS
BUILD_THIRDPARTY_SERVER     = files.zimbra.com
INTERACTIVE                 = 0

Then just run ./build.pl.

The above command, run on a CentOS 7 machine with the options as shown in config.build, created the following:

$HOME/installer-build/BUILDS/RHEL7_64/JUDASPRIEST-876/20170323061131_FOSS/zm-build/zcs-8.7.6_GA_1713.RHEL7_64.20170323061131.tgz

Development

Setup

The following is a walk-through of the basic steps required to do ZCS development. The first step is to simply install a current FOSS build on the machine that you wish to use. The instructions that follow assume that this has been done.

  1. Create /home/zimbra and make zimbra the owner.

     sudo mkdir /home/zimbra
     sudo chown zimbra:zimbra /home/zimbra
    
  2. Install git, ant, and ant-contrib by whichever method is appropriate for your distro:

     sudo apt-get install git ant ant-contrib
    

    or

     sudo yum install git ant ant-contrib
    
  3. Configure /opt/zimbra/.ssh/config to use your ssh key for the git remotes that you need to access.

  4. Perform the following edits on /opt/zimbra/.bash_profile

    • Comment-out export LANG=C and export LC_ALL=C.
    • Add export LANG=en_US.UTF-8
    • Add export ANT_OPTS=-Ddev.home=/home/zimbra
  5. Change permissions on files and folders that you will be updating; e.g.,

     sudo chmod -R o+w /opt/zimbra/lib/
     sudo chmod -R o+w /opt/zimbra/jetty/
     sudo chown zimbra:zimbra /opt/zimbra
    

    Note: If you run zmfixperms, some of these permissions will be overwritten.

  6. Add file /opt/zimbra/.gitconfig and update as needed. At a minimum:

     [user]
     	email = YOUR-EMAIL-ADDRESS
     	name = YOUR-FIRST-AND-LAST-NAME
    
  7. As the zimbra user, create a base directory under /home/zimbra from which to work.

     cd /home/zimbra
     mkdir zcs
     cd zcs
    
  8. Now you can clone any repositories that you require and get to work.

Email Delivery

If you want email delivery to work, set up a DNS server on your host machine or another VM and configure zimbraDNSMasterIP to point to it. To configure zimbraDNSMasterIP, do the following as the zimbra user:

zmprov ms `zmhostname` zimbraDNSMasterIP DNS-SERVER-IP-ADDRESS

You may receive the following error when trying to send email:

No SMTP hosts available for domain

If this occurs, you need to manually configure zimbraSmtpHostname for your domain(s). To configure zimbraSmtpHostname, do the following as the zimbra user:

zmprov md DOMAIN-NAME zimbraSmtpHostname `zmhostname`

zm-mailbox example

As the zimbra user, cd /home/zimbra/zcs. Then clone the zm-mailbox repository from github

git clone [email protected]:Zimbra/zm-mailbox.git

The following sub-directories zm-mailbox build and deploy separately:

client
common
milter-conf
native
soap
store
store-conf

The top-level build.xml is used by the zm-build scripts to create an installer package. You will not use that for normal development. There are build-order dependencies between the above-listed deployment targets. These can be determined by inspection of the ivy.xml files within each subdirectory.

For example:

grep 'org="zimbra"' store/ivy.xml

<dependency org="zimbra" name="zm-common" rev="latest.integration"/>
<dependency org="zimbra" name="zm-soap" rev="latest.integration"/>
<dependency org="zimbra" name="zm-client" rev="latest.integration"/>
<dependency org="zimbra" name="zm-native" rev="latest.integration"/>

Here you can see that the deployment target, zm-store (the store subdirectory), depends upon common, soap, client, and native. Here is the current ordering dependencies among all of the zm-mailbox deployment targets. The higher-numbered deployment targets depend upon the lower-numbered ones. Note that milter-conf and store-conf have no cross-dependencies.

  1. native
  2. common
  3. soap
  4. client
  5. store

So, from the native sub-directory:

ant -Dzimbra.buildinfo.version=8.7.6_GA clean compile publish-local deploy

Comments:

  • The requirement to include -Dzimbra.buildinfo.version=8.7.6_GA to ant is due to a change that was made when the FOSS code was moved to GitHub. You can also just add that option to your ANT_OPTS enviroment variable that you defined in $HOME/.bash_profile as follows:

    export ANT_OPTS="-Ddev.home=/home/zimbra -Dzimbra.buildinfo.version=8.7.6_GA"
    

    If you do that, then you can omit that -D... argument to the ant command and future examples will reflect that.

  • The publish-local target adds the artifact to /home/zimbra/.zcs-deps, which is included in the Ivy resolution path.

  • The deploy target installs the artifact to its run-time location and restarts the appropriate service(s). This will allow you to test your changes.

Then, from the common, soap, client, and store sub-directories (in that order):

ant clean compile publish-local deploy

Adding a new LDAP Attribute

WARNING:It is absolutely imperative to avoid duplicate IDs for attributes. Unfortunately, that currently isn't a trivial thing to do. Need to check Zimbra 8 and Zimbra X along with all development branches. If customers get different setups using different IDs, this makes future upgrade scenarios a complete nightmare

Start by cloning both the zm-ldap-utilites and the zm-mailbox repositories from GitHub. Check out the appropriate branch of each. Then proceed as follows:

  • Add your new attribute to zm-mailbox/store/conf/attrs/zimbra-attrs.xml

  • From zm-common/store invoke the following command:

      ant generate-getters
    
  • Do the following as root:

      chmod -R o+w /opt/zimbra/common/etc/openldap/schema
      chmod o+w /opt/zimbra/conf/zimbra.ldif
      chmod +w /opt/zimbra/conf/attrs/zimbra-attrs.xml
      chmod -R o+w /opt/zimbra/common/etc/openldap/zimbra
    
  • Back as the zimbra user, invoke the following command from zm-mailbox/common:

      ant deploy publish-local
    
  • Then from the zm-mailbox/store directory:

      ant deploy update-ldap-schema
    

Your ZCS development server should now be running with the new attribute(s). You can test that by querying them and modifying them with zmprov. You can git add ... and git commit your changes now.

More Repositories

1

zm-mailbox

zm-mailbox for Zimbra Collaboration Suite, FOSS Edition
Java
66
star
2

zm-web-client

zm-web-client for Zimbra Collaboration Suite, FOSS Edition
JavaScript
38
star
3

adminguide

Zimbra Administration Guide
38
star
4

installguides

Zimbra Installation Guides
Shell
26
star
5

elastic-stack

A guide on using Zimbra with Elastic Stack using centralized logging
Shell
25
star
6

docker-zcs-foss

A persisting Zimbra docker container for testing purposes
Shell
21
star
7

zimbra-ml

Zimbra Machine Learning GraphQL Server
Python
17
star
8

keycloak

Zimbra with on premise Single Sign-On using Keycloak
16
star
9

zm-api-js-client

A javascript and GraphQL client for making requests against the Zimbra SOAP API.
TypeScript
16
star
10

zinstaller

Automated installation of Zimbra
Shell
16
star
11

zm-docker-zimbra-org

Development moved to ZimbraOS org.
Perl
13
star
12

zimlet-cli

Client tool to Develop, Build, and Package Zimbra X compatible zimlets for development and production.
JavaScript
13
star
13

packages

ZCS Third Party Dependency Build System
Makefile
11
star
14

zd-full

Zimbra Desktop
HTML
8
star
15

zm-zimlet-guide

Zimbra Modern UI react Zimlets 101 how-to article
JavaScript
7
star
16

zm-extension-guide

Zimbra Back-End Extensions how-to article
Java
6
star
17

zimbra-zimlet-export-eml

Adds a button in the more menu to export an email to eml.
JavaScript
5
star
18

zimbra-zimlet-sticky-notes

Sticky Notes Zimlet for Modern UI as a guide
JavaScript
5
star
19

vagrant-provision-zimbra

Vagrant provisioning scripts for various Zimbra related environments
Shell
5
star
20

zm-core-utils

zm-core-utils for Zimbra Collaboration Suite, FOSS Edition
Perl
5
star
21

zm-admin-console

zm-admin-console for Zimbra Collaboration Suite, FOSS Edition
JavaScript
5
star
22

Mezeo-Vendor-Storage-Module-SDK

SDK for creating new Vendor Storage Modules for Mezeo
Python
4
star
23

zimbra-zimlet-rocketchat

Rocket Chat integration for Zimbra 9
JavaScript
3
star
24

zm-openid-consumer-store

zm-openid-consumer-store for Zimbra Collaboration Suite, FOSS Edition
Java
3
star
25

zm-base-os

Dockerfile
3
star
26

zm-x-ui

LESS mixins, CSS variables, and icons used by the Zimbra X client
Less
3
star
27

zimbra-zimlet-email-templates

Email templates Zimlet for Zimbra 9/Cloud
JavaScript
3
star
28

simioj

Clojure
3
star
29

zimbra-build

Packaging code required by ZCS, ZD, ZCO
Shell
3
star
30

zm-x-zimlet-template-default

Default template for use with zimlet-cli to create ZimbraX compatible zimlets
JavaScript
3
star
31

zm-zimlets

zm-zimlets for Zimbra Collaboration Suite, FOSS Edition
JavaScript
3
star
32

zm-mta

zm-mta for Zimbra Collaboration Suite, FOSS Edition
2
star
33

zm-viewmail-admin-zimlet

zm-viewmail-admin-zimlet for Zimbra Collaboration Suite, FOSS Edition
JavaScript
2
star
34

zm-postfix

zm-postfix for Zimbra Collaboration Suite, FOSS Edition
2
star
35

zm-ajax

zm-ajax for Zimbra Collaboration Suite, FOSS Edition
JavaScript
2
star
36

zm-nextcloud-extension

Back end for Nextcloud Zimlet
Java
2
star
37

zm-nginx-conf

zm-nginx-conf for Zimbra Collaboration Suite, FOSS Edition
2
star
38

zm-ldap-utils-store

zm-ldap-utils-store for Zimbra Collaboration Suite, FOSS Edition
Java
2
star
39

qless-java

Java bindings for qless Redis-based job tracking
Java
2
star
40

zm-web-client-help

Help for the Zimbra Web Client
HTML
2
star
41

zm-downloads

zm-downloads for Zimbra Collaboration Suite, FOSS Edition
2
star
42

zm-x-client-proxy

Lightweight HA Proxy Service
Makefile
2
star
43

zm-nginx-lookup-store

zm-nginx-lookup-store for Zimbra Collaboration Suite, FOSS Edition
Java
2
star
44

zm-captcha-service

This repository will serve the capthca image as well as will validate the captcha request
Go
2
star
45

zm-jetty-conf

zm-jetty-conf for Zimbra Collaboration Suite, FOSS Edition
AMPL
2
star
46

zm-zcs

zm-zcs for Zimbra Collaboration Suite, FOSS Edition
2
star
47

zm-oauth-social

Zimbra OAuth2 Social API
Java
2
star
48

zm-migration-tools

zm-migration-tools for Zimbra Collaboration Suite, FOSS Edition
Java
2
star
49

zm-clientuploader-admin-zimlet

zm-clientuploader-admin-zimlet for Zimbra Collaboration Suite, FOSS Edition
JavaScript
2
star
50

zimbra-zimlet-nextcloud

A modern UI Nextcloud Zimlet
Less
2
star
51

email-recall

This Zimlet lets a user recall an email message
Java
2
star
52

zimbra-zimlet-google-translate

Google Translate Zimlet
JavaScript
2
star
53

out-of-office-alert-zimlet

This Classic UI Zimlets displays an alert as soon as you enter an email address in to/cc/bcc of someone with an active out of office reply.
Java
2
star
54

spamhaus-hbl-milter

A Milter for using Spamhaus HBL with Zimbra/Postfix
Python
2
star
55

confidential-header-zimlet

Classic UI Zimlet allows the user to add and view the Confidential/Sensitivity Header based on RFC2156.
JavaScript
2
star
56

cisco-duo-saml

How to set-up Zimbra on Cisco Duo
1
star
57

zimbra-zimlet-simple-theme

Change the Modern UI appearance in a fast and easy way
JavaScript
1
star
58

zimbra-custom-authentication

How to create a custom authentication extension for Zimbra
Java
1
star
59

admin-console-zimlets-and-extensions-guide

How to write Admin console Zimlets and Extensions
1
star
60

zm-launcher

zm-launcher for Zimbra Collaboration Suite, FOSS Edition
C
1
star
61

zimbra-package-stub

Stub files for package builds
Shell
1
star
62

zm-load-testing

Java
1
star
63

zm-charset

zm-charset for Zimbra Collaboration Suite, FOSS Edition
1
star
64

zm-genesis

Zimbra Genesis Test Suite
Ruby
1
star
65

zm-zcs-lib

zm-zcs-lib for Zimbra Collaboration Suite, FOSS Edition
Perl
1
star
66

zimbra-zimlet-bigbluebutton

Add BigBlueButton meeting information to calendar appointments in Zimbra
Less
1
star
67

zimbra-zimlet-anyframe

Integrate 3rd party web-apps in Zimbra with the AnyFrame Zimlet
JavaScript
1
star
68

zm-jython

zm-jython for Zimbra Collaboration Suite, FOSS Edition
Python
1
star
69

zimbra-zimlet-voice-message

Tired of typing? Use Voice Message Zimlet to record a message from Zimbra
JavaScript
1
star
70

zm-soap-harness

Zimbra test harness for running SOAP backend request/response
Java
1
star
71

zimbra-zimlet-attacher

Adding attachments from a Zimlet
Less
1
star
72

zm-help

zm-help for Zimbra Collaboration Suite, FOSS Edition
HTML
1
star
73

zm-proxy-config-admin-zimlet

zm-proxy-config-admin-zimlet for Zimbra Collaboration Suite, FOSS Edition
JavaScript
1
star
74

zm-gql

Zimbra GraphQL API
Java
1
star
75

zimbra-bugzilla-scrum

JavaScript
1
star
76

zm-helptooltip-zimlet

zm-helptooltip-zimlet for Zimbra Collaboration Suite, FOSS Edition
JavaScript
1
star
77

zm-ldap-utilities

zm-ldap-utilities for Zimbra Collaboration Suite, FOSS Edition
Perl
1
star
78

oauth2_datasources

collection of datasources that connect to external APIs with Oauth2 authentication
Java
1
star
79

zm-webclient-portal-example

zm-webclient-portal-example for Zimbra Collaboration Suite, FOSS Edition
1
star
80

zimbra-zimlet-xspam

The X-Spam Zimlet displays the X-Spam-Status and X-Spam-Score headers from emails in the UI.
JavaScript
1
star
81

zimbra-zimlet-import-ics

Import event from ICS
JavaScript
1
star
82

zm-load

Docker container executing JMeter against a configured Zimbra instance (in or outside of Docker)
Shell
1
star
83

zm-selenium

zm-selenium for Zimbra Collaboration Suite, FOSS Edition
Java
1
star
84

zm-db-conf

zm-db-conf for Zimbra Collaboration Suite, FOSS Edition
Perl
1
star
85

zm-versioncheck-admin-zimlet

zm-versioncheck-admin-zimlet for Zimbra Collaboration Suite, FOSS Edition
JavaScript
1
star
86

zimbra-zimlet-user-properties

A guide on using Zimlet User Properties on Modern UI
JavaScript
1
star
87

zm-clientuploader-store

zm-clientuploader-store for Zimbra Collaboration Suite, FOSS Edition
Java
1
star
88

custom-milter

How to create a custom Milter on Zimbra
1
star
89

zimbra-zimlet-signature-template

Guide on interacting with Zimbra Composer using Zimlets - Signature Template
JavaScript
1
star
90

zimbra-zimlet-social-justice

The Social Justice Zimlet searches for words while you type an email and suggests alternative words.
JavaScript
1
star
91

per-user-attach-limit

Per user attachment size limit
JavaScript
1
star
92

zimbra-zimlet-email-reminder

Email Reminder Zimlet, create a calendar reminder based on an email message.
JavaScript
1
star
93

zm-ssdb-ephemeral-store

zm-ssdb-ephemeral-store for Zimbra Collaboration Suite, FOSS Edition
Java
1
star