Rename ci Docker file 82/3782/3
authorTimo Tietavainen <timo.tietavainen@nokia.com>
Thu, 21 May 2020 08:27:40 +0000 (11:27 +0300)
committerTimo Tietavainen <timo.tietavainen@nokia.com>
Thu, 21 May 2020 13:08:13 +0000 (16:08 +0300)
SDL Continuous Integration (ci) tests are not anymore run on a docker
but instead directly on the Jenkins minion (virtual machine). That's
why remove unnecessary ci directory with its docker files and move the
files to docker_test directory. Docker can be used for local testing
purposes.

Change-Id: Iac527243927c925b35a03fcbaef36972bafa4488
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
README.md
docker_test/Dockerfile-Test [moved from ci/Dockerfile with 97% similarity]
docker_test/publish.sh [moved from ci/publish.sh with 100% similarity]
docs/developer-guide.rst
package.sh [deleted file]

index 4c76fd9..72c3422 100644 (file)
--- a/README.md
+++ b/README.md
@@ -208,6 +208,18 @@ analysis:
 
 Open the out/index.html using any web browser.
 
+## Docker Tests
+
+It's also possible to test SDL compilation, run unit tests and test building of
+rpm and Debian packages in a Docker:
+
+    docker build  --no-cache -f docker_test/Dockerfile-Test -t sdltest:latest .
+
+If needed, ready rpm and Debian packages can be copied from Docker to host. In
+below example packages are copied to host's /tmp/sdltest-packages directory:
+
+    docker run -v /tmp/sdltest-packages:/export sdltest:latest /export
+
 ## Using SDL in application pod
 
 SDL is not yet available in O-RAN-SC PackageCloud.io repository.
similarity index 97%
rename from ci/Dockerfile
rename to docker_test/Dockerfile-Test
index 83a2c2c..ba43f67 100644 (file)
@@ -62,5 +62,5 @@ RUN make clean && \
     ./configure --with-deb-dir=/tmp/pkgs && \
     make deb-pkg
 
-RUN cp /tmp/build/ci/publish.sh /bin
+RUN cp /tmp/build/docker_test/publish.sh /bin
 ENTRYPOINT ["/bin/publish.sh"]
similarity index 100%
rename from ci/publish.sh
rename to docker_test/publish.sh
index cdf5567..4d9851b 100644 (file)
@@ -210,14 +210,14 @@ supports, for example::
     ./testrunner --gtest_filter=AsyncStorageTest*
 
 To get unit test code coverage analysis enable unit test gcov code coverage
-analysis by configuring gcov reporting directory:
+analysis by configuring gcov reporting directory::
 
     configure --with-gcov-report-dir=DIR
 
 Directory can be an absolute path or a relative path to an SDL source root.
 Unit test build creates directory if it does not exist.
 
-Build and run unit tests with code coverage analysis:
+Build and run unit tests with code coverage analysis::
 
     make test_gcov
 
@@ -225,13 +225,27 @@ After successful unit test run code coverage (.gcov) result files are in
 a directory, what was defined by '--with-gcov-report-dir' configure option.
 
 In addition, graphical gcov front-ends such as lcov can be used for coverage
-analysis:
+analysis::
 
     lcov --directory tst/ --directory src --capture --output-file coverage.info
     genhtml coverage.info --output-directory out
 
 Open the out/index.html using any web browser.
 
+
+Docker Tests
+============
+
+It's also possible to test SDL compilation, run unit tests and test building of
+rpm and Debian packages in a Docker::
+
+    docker build  --no-cache -f docker_test/Dockerfile-Test -t sdltest:latest .
+
+If needed, ready rpm and Debian packages can be copied from Docker to host. In
+below example packages are copied to host's /tmp/sdltest-packages directory::
+
+    docker run -v /tmp/sdltest-packages:/export sdltest:latest /export
+
 Functional Tests
 ================
 
diff --git a/package.sh b/package.sh
deleted file mode 100755 (executable)
index e525c94..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2018-2019 Nokia.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#
-# This source code is part of the near-RT RIC (RAN Intelligent Controller)
-# platform project (RICP).
-#
-
-set -e
-
-if [ $# -eq 0 ]
-then
-   echo "Generate a binary package"
-   echo "Usage: $0 [--target-dir <dir>] [--skip-config] target..."
-   echo "Where possible targets are debian and rpm"
-   exit 1
-fi
-
-SKIP_CONF=0
-BUILD_RPM=0
-BUILD_DEB=0
-SKIP_TEST=0
-TARGET_DIR=/tmp
-
-for i in "$@"
-do
-    case "$i" in
-    --target-dir)
-        shift
-        TARGET_DIR=$i
-        ;;
-    --skip-config)
-        SKIP_CONF=1
-        ;;
-    --skip-test)
-        SKIP_TEST=1
-        ;;
-    rpm)
-        BUILD_RPM=1
-        shift
-        ;;
-    debian)
-        BUILD_DEB=1
-        ;;
-    *)
-        echo "Unknown argument $1"
-        exit 1
-        ;;
-    esac
-done
-
-if [ $SKIP_CONF -eq 0 ]
-then
-    ./autogen.sh && ./configure
-fi
-
-if [ $BUILD_RPM -ne 0 ]
-then
-    if [ $SKIP_TEST ]
-    then
-        TESTOPT=--nocheck
-    fi
-    rpmbuild --nodeps $TESTOPT -bb rpm/sdl.spec --define="_sourcedir $PWD" --define="_builddir $PWD" --define="_rpmdir .."
-    cp ../x86_64/*.rpm "$TARGET_DIR"
-fi
-
-if [ $BUILD_DEB -ne 0 ]
-then
-    if [ $SKIP_TEST -eq 1 ]
-    then
-        export DEB_BUILD_OPTIONS="nocheck noddebs"
-    fi
-    debuild -b -us -uc
-fi