The YaST C++ Testing Image
- The image is rebuilt whenever a commit it pushed to the
- The yast-ci-cpp-container-master Jenkins job copies the configuration to the YaST:Head/ci-cpp-container OBS project
- The OBS tracks the dependencies and rebuilds the image if any dependant package is updated.
Triggering a Rebuild Manually
If for some reason the automatic rebuild do not work or it failed you can trigger the rebuild in the OBS just like for the other regular packages.
The Image Content
This image is based on the latest openSUSE Tumbleweed image, additionally it contains the packages needed for running the tests for YaST packages written in C++. It is possible to install additional packagers if needed, see the Examples section below.
Using the Image in the Other Projects
The image contains the
yast-travis-cpp script which runs all the checks and tests.
The workflow is:
- Copy the sources into the
- If the code needs additional packages install them using the
zypper installcommand from the local
Dockerfile. If the package can be used by more modules you can add it into the base Docker image here.
- Run the
yast-travis-cppscript. (Optionally you can use the
-ooptions to split the work into several smaller tasks and run them in parallel, see the yast2-storage-ng example.)
FROM registry.opensuse.org/yast/head/containers/yast-cpp # optionally install additional packages if needed: # RUN zypper --non-interactive install --no-recommends \ # libxml2-devel \ # yast2-core-devel # copy the sources into the image COPY . /usr/src/app
sudo: required language: bash services: - docker before_install: - docker build -t yast-foo-image . # list the installed packages (just for easier debugging) - docker run --rm -it yast-foo-image rpm -qa | sort script: # the "yast-travis-cpp" script is included in the base yast-ruby image # see https://github.com/yast/ci-cpp-container/blob/master/package/yast-travis-cpp - docker run -it --rm -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-foo-image yast-travis-cpp
foo with your package name to avoid collisions with the other packages
when running the same commands locally.)
Building the Image Locally
Using the OSC Tool
From the Git sources:
# you need the rubygem-yast-rake package installed rake osc:build
From the OBS checkout:
# check it out if not already present osc co YaST:Head/ci-cpp-container cd YaST:Head/ci-cpp-container # build it osc build containers
Using the Docker tool
osc described above.
osc build injects some special modifications to allow building the image inside
the OBS build environment.
osc method if possible, use the
build only as a fallback when the
osc build is not possible or does not work in your environment.
docker build -t ci-cpp-container-test -f package/Dockerfile package/