From: Lott, Christopher (cl778h) Date: Mon, 10 Jun 2019 20:53:39 +0000 (-0400) Subject: Simplify continuous-integration build X-Git-Tag: 1.0.36~13 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=f89eec503272760b0a323c342c76eb013fcf795a;p=ric-plt%2Flib%2Frmr.git Simplify continuous-integration build Extend dockerfile to call make package. Move dockerfile to new ci subdirectory. Remove the (now unneeded) container tag file. Document the docker-based build process. Signed-off-by: Lott, Christopher (cl778h) Change-Id: I94f9cb9eaabd797b76011aa9c6229345a799d4f9 --- diff --git a/BUILD b/BUILD index 6f9074c..adae2f1 100644 --- a/BUILD +++ b/BUILD @@ -21,7 +21,7 @@ Building RMr The RIC Message Router (RMr) is built with CMake, and requires -a modern gcc compiler and make to be installed on the build +a modern gcc compiler and make to be installed on the build system. Typically, installing the following list of packages in a container (Ubuntu) is all that is needed to craft a development environment (containerised builds are also the @@ -43,14 +43,18 @@ To build RMr, the usual CMake steps are followed: This will create a .deb (provided the system supports this) in the build directory. It's that simple. +Continuous integration build +Use the Dockerfile in the ci/ subdirectory. This installs all +the required tools and creates an image in the local registry. + Alternatives To build in a non-Linux environment, or to build with an alternate install path (or both) read on. -Instead of using 'make package' as listed above, using +Instead of using 'make package' as listed above, using 'make install' will build and install on the local system. -By default, the target install is into /usr/local which may +By default, the target install is into /usr/local which may not be desired. To install into an alternate path add these two options when the 'cmake ..' command is given: @@ -59,8 +63,8 @@ these two options when the 'cmake ..' command is given: The first will cause the make process to install into the named -directory, which can be in your home directory. The second -defines where manual pages are placed (if not defined +directory, which can be in your home directory. The second +defines where manual pages are placed (if not defined /usr/share/man is the target). Manual pages are generally NOT built as the required tool has yet to be incorporated into the build process and generally is not available on most systems. @@ -68,27 +72,27 @@ the build process and generally is not available on most systems. Compiling and Linking Should the Rmr and NNG/Nano libraries be installed in a directory -outside of the normal system spots (e.g. not in /usr/local) -it might be necessary to define the specific directory for +outside of the normal system spots (e.g. not in /usr/local) +it might be necessary to define the specific directory for libraries (.e.g -L) on the command line, or via environment variables (e.g.. C_INCLUDE_PATH, LD_LIBRARY_PATH, LIBRARY_PATH). It may also be necessary to have the library directory defined in the environment at run time. It is difficult to know what -each system needs, but the following linker ooptions work when +each system needs, but the following linker ooptions work when libraries are installed in the system spots: -lrmr_nng -lnng -lpthread -Adding -L is one way to compensate when libraries are installed +Adding -L is one way to compensate when libraries are installed a different spot (e.g. in $HOME/usr): -L $HOME/usr -lrmr_nng -lnng -lpthread Libraries -RMr supports both NNG and Nanomsg as underlying transport. They -are separate beasts, and while an NNG based programme can -communicate with a Nanomsg based programme, their APIs are NOT +RMr supports both NNG and Nanomsg as underlying transport. They +are separate beasts, and while an NNG based programme can +communicate with a Nanomsg based programme, their APIs are NOT compatible. For this reason, and others, RMr generates two libraries and requires that the underlying transport be selected at link time rather than run time. The RMr API for both underlying @@ -111,6 +115,6 @@ the following option to the cmake command: This will cause the {X}fm text formatting package to be fetched (github) and built at cmake time (must exist before building) and will trigger the generation of the man pages in both postscript -and troff format. The troff pages are placed into the deb and -the postscript pages are left in the build directory for the +and troff format. The troff pages are placed into the deb and +the postscript pages are left in the build directory for the developer to convert to PDF, or otherwise use. diff --git a/Dockerfile b/ci/Dockerfile similarity index 98% rename from Dockerfile rename to ci/Dockerfile index 8900e9c..9d4afc0 100755 --- a/Dockerfile +++ b/ci/Dockerfile @@ -22,7 +22,7 @@ FROM buildpack-deps:stretch RUN apt-get update && apt-get -q -y install cmake ksh ADD . /tmp # tests require directory named ".build" -RUN cd /tmp && mkdir .build && cd .build && cmake .. && make install +RUN cd /tmp && mkdir .build && cd .build && cmake .. && make install && make package # tests require a Linux host, fail in a Linux VM on mac/win RUN cd /tmp/test && ksh unit_test.ksh -v RUN cd /tmp/test/app_test && ksh run_all.ksh diff --git a/ci/README.md b/ci/README.md new file mode 100644 index 0000000..e04f067 --- /dev/null +++ b/ci/README.md @@ -0,0 +1,7 @@ +# Continuous Integration + +This directory contains configuration for the Jenkins CI system to +build a docker image with the software in this repository. + +Additional files required to build a Docker image, for example a +script for the CMD or ENTRYPOINT, might also be stored here. diff --git a/container-tag.yaml b/container-tag.yaml deleted file mode 100644 index da875ad..0000000 --- a/container-tag.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# The Jenkins job requires a tag to build a Docker image ---- -tag: never-pushed