Merge "supporting docs for SO"
[so.git] / docs / 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 2017 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.  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.
38
39 If you are behind a corporate firewall, you can specify proxy definitions for the constructed docker images.
40
41 **Remove existing docker containers and images**
42
43 .. code-block:: bash
44
45   docker stop $(docker ps -qa)
46
47   docker rm $(docker ps -aq)
48
49   docker rmi -f $(docker images -q)
50
51 **Build docker images (without proxy definition):**
52
53 .. code-block:: bash
54
55   cd $HOME/onap/workspace/SO/so/packages
56
57   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
58   -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
59   -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
60   -Ddocker.buildArg.http_proxy=http://one.proxy.att.com:8080
61   -Ddocker.buildArg.https_proxy=http://one.proxy.att.com:8080
62
63 **Build docker images (with proxy definition):**
64
65 .. code-block:: bash
66
67   cd $HOME/onap/workspace/SO/so/packages
68   
69   $HOME/onap/apache-maven-3.3.9/bin/mvn -s $HOME/onap/.m2/settings.xml clean install -P docker
70   -Dmso.chef.git.url.prefix=ssh://$USER@gerrit.onap.org:29418 -Dmso.chef.git.branchname=master
71   -Dmso.chef.git.url.suffix.chef.repo=so/chef-repo -Dmso.chef.git.url.suffix.chef.config=so/so-config
72   -Ddocker.buildArg.http_proxy=http://proxyhost:port -Ddocker.buildArg.https_proxy=http://proxyhost:port
73
74 Build with Integration Tests
75 -----------------------------
76
77 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.
78
79