url correction and improve API doc
[so.git] / docs / developer_info / Building_SO.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2018 Huawei Technologies Co., Ltd.
4
5 Building SO
6 ============
7
8 Build software with unit tests
9 ------------------------------
10
11 .. code-block:: bash
12
13   cd $HOME/onap/workspace/SO/libs
14
15   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install
16
17   cd $HOME/onap/workspace/SO/so
18
19   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install
20
21 Build software without unit tests
22 ----------------------------------
23
24 .. code-block:: bash
25
26   cd $HOME/onap/workspace/SO/libs
27
28   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml -DskipTests -Dmaven.test.skip=true clean install
29
30   cd $HOME/onap/workspace/SO/so
31
32   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml -DskipTests -Dmaven.test.skip=true clean install
33
34 Build docker images
35 --------------------
36
37 SO docker images are built using the "docker" maven profile.  
38
39 During the build, the chef-repo and so-docker repositories are cloned from gerrit into the "so" directory structure.  Extra definitions are required in the build environment to make this happen.   You may need to adjust the definition of mso.chef.git.url.prefix to match the way you authenticate yourself when performing git clone.
40
41 If you are behind a corporate firewall, you can specify proxy definitions for the constructed docker images.
42
43 **Remove existing docker containers and images**
44
45 .. code-block:: bash
46
47   docker stop $(docker ps -qa)
48
49   docker rm $(docker ps -aq)
50
51   docker rmi -f $(docker images -q)
52
53 **Build docker images (without proxy definition):**
54
55 .. code-block:: bash
56
57   cd $HOME/onap/workspace/SO/so/packages
58
59   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
60   -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
61   -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
62   -Ddocker.buildArg.http_proxy=http://one.proxy.att.com:8080
63   -Ddocker.buildArg.https_proxy=http://one.proxy.att.com:8080
64
65 **Build docker images (with proxy definition):**
66
67 .. code-block:: bash
68
69   cd $HOME/onap/workspace/SO/so/packages
70   
71   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
72   -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
73   -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
74   -Ddocker.buildArg.http_proxy=http://proxyhost:port -Ddocker.buildArg.https_proxy=http://proxyhost:port
75
76 Build with Integration Tests
77 -----------------------------
78
79 This is done exactly as described for building docker images, except that the maven profile to use is "with-integration-tests" instead of "docker".  Integration tests are executed inside docker containers constructed by the build.
80
81