blob: 7d68e433cc2ce07aa04d4137adacb6575e0b7f36 [file] [log] [blame]
seshukm1c71d712017-11-06 11:35:39 +05301.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
seshukmb7cc0c82018-07-18 17:33:46 +08003.. Copyright 2018 Huawei Technologies Co., Ltd.
seshukm1c71d712017-11-06 11:35:39 +05304
5Building SO
6============
7
8Build 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
21Build 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
34Build docker images
35--------------------
36
seshukmb5bd4da2018-07-31 10:52:30 +080037SO docker images are built using the "docker" maven profile.
38
39During 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.
seshukm1c71d712017-11-06 11:35:39 +053040
41If 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
76Build with Integration Tests
77-----------------------------
78
79This 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