diff --git a/docs/Development.md b/docs/Development.md index 6b5d353af..681923318 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -1,6 +1,6 @@ -### Get the source code +## Get the source code Besides the omsagent core itself, OMS Agent consists of an number of other components and their kits (shell bundles). We have a root project called Build-OMS-Agent-for-Linux in the GitHub to build them all, which references the 10 components as submodules. @@ -11,6 +11,26 @@ We have a root project called Build-OMS-Agent-for-Linux in the GitHub to build t - pal (Platform Abstraction Layer) - scxcore-kits (System Center Cross Platform Provider for Operations Manager) +##### Git error: +You need a new version of git (2.17+) to prevent from getting this error: +``` +fatal: not a git repository: /home/USER/Build-OMS-Agent-for-Linux/.git/modules/omsagent/modules/source/ext/ruby +``` + +Install git dev dependencies: +``` +# For Redhat +sudo dnf install dh-autoreconf curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel + +# For Debian +sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev + +# Compile & Install +wget https://github.com/git/git/archive/v2.17.1.tar.gz +tar -xzf v2.17.1.tar.gz +cd git-2.17.1/ && make configure && ./configure --prefix=/usr && make all +sudo make install +``` To build the bundle, you need to clone the Build-OMS-Agent-for-Linux repository. @@ -23,6 +43,18 @@ git branch my-feature-1 ``` ### Setup environment with a build container (Docker) + +##### Setup DNS +If you run docker container from inside a private corp network set your DNS as follow: +``` +sudo echo '{ +"dns": ["YOUR_DNS", "YOUR_DNS"] +}' > /etc/docker/daemon.json + +sudo service docker restart +``` + +##### Setup Docker container Our build environment is based on Centos, you can setup your own dev container by choosing the right docker file under ./build/docker folder. @@ -39,7 +71,7 @@ docker pull abenbachir/oms-centos6-x64 Then you can start a build container instance: ``` -docker run --rm -itv /home/$(whoami)/:/home/scratch/Build-OMS-Agent-for-Linux -w /home/scratch/OMS/Build-OMS-Agent-for-Linux/omsagent/build abenbachir/oms-centos6-x64:latest +docker run --rm -itv /home/$(whoami)/:/home/scratch/OMS -w /home/scratch/OMS/Build-OMS-Agent-for-Linux/omsagent/build abenbachir/oms-centos6-x64:latest ``` ### Building steps @@ -59,4 +91,4 @@ make unittest You can clean-up and reset your workspace with: ``` make distclean -``` \ No newline at end of file +```