diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ba72ddceb31d0b916fb04e88f389726905e24d3..b2e643249d22011a104dea6ddc1ef61bac4e4304 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,23 +42,34 @@ stages: - . bootstrap/etc/lofar20rc.sh || true ## Allow docker image script to execute # - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh + +# Template for docker images NOT on tagged or master builds .base_docker_images_except: extends: .base_docker_images except: refs: - tags - master + +# Template to download all remote images and store them on our image registry +# (call tag_and_push without arguments) .base_docker_store_images: extends: .base_docker_images script: # Do not remove 'bash' or statement will be ignored by primitive docker shell - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh + +# Download all remote images and store them on our image registry for tagged +# master builds docker_store_images_master_tag: extends: .base_docker_store_images only: refs: - tags - master + +# Download all remote images and store them on our image registry if .env changes +# on a merge request docker_store_images_changes: extends: .base_docker_store_images # This will spawn as detached pipeline but atleast ensures the changes rule @@ -70,6 +81,8 @@ docker_store_images_changes: - merge_requests changes: - docker-compose/.env + +# Build and push all our custom images on tagged or master builds docker_build_image_all: extends: .base_docker_images only: @@ -114,30 +127,32 @@ docker_build_image_all: - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh archiver-timescale latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-cm latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh hdbppts-es latest -docker_build_image_elk: + +# Build and push custom images on merge request if relevant files changed +docker_build_image_lofar_device_base: extends: .base_docker_images_except only: refs: - merge_requests changes: - - docker-compose/elk.yml - - docker-compose/elk/* - - docker-compose/elk-configure-host/* + - docker-compose/lofar-device-base.yml + - docker-compose/lofar-device-base/* script: # Do not remove 'bash' or statement will be ignored by primitive docker shell - - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk $tag - - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk-configure-host $tag -docker_build_image_lofar_device_base: + - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag +docker_build_image_elk: extends: .base_docker_images_except only: refs: - merge_requests changes: - - docker-compose/lofar-device-base.yml - - docker-compose/lofar-device-base/* + - docker-compose/elk.yml + - docker-compose/elk/* + - docker-compose/elk-configure-host/* script: # Do not remove 'bash' or statement will be ignored by primitive docker shell - - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag + - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk $tag + - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh elk-configure-host $tag docker_build_image_prometheus: extends: .base_docker_images_except only: diff --git a/docker-compose/lofar-device-base/Dockerfile b/docker-compose/lofar-device-base/Dockerfile index faa0f761a8ec60932292d2196fe5ae67471f5b75..56477027b72c0c116d728c8526f05c1961174728 100644 --- a/docker-compose/lofar-device-base/Dockerfile +++ b/docker-compose/lofar-device-base/Dockerfile @@ -6,8 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive ARG DEBCONF_NONINTERACTIVE_SEEN=true RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections -RUN sudo apt-get update && sudo apt-get install -y git g++ gcc shellcheck graphviz python3-dev libboost-python-dev libtango-dev pkg-config && sudo apt-get clean - +RUN sudo apt-get update && sudo apt-get install -y git g++ gcc shellcheck graphviz python3-dev libboost-python-dev pkg-config && sudo apt-get clean COPY lofar-device-base/lofar-requirements.txt /lofar-requirements.txt RUN sudo pip3 install -r /lofar-requirements.txt diff --git a/tangostationcontrol/tox.ini b/tangostationcontrol/tox.ini index 67b212028f7f512ae94800d36923c9ebe7d2046b..a5e8e0736025f99b7a200c765a603c9d0a58cff4 100644 --- a/tangostationcontrol/tox.ini +++ b/tangostationcontrol/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.20 -envlist = py37,py38,py39,py310,pep8 +envlist = py3{7,8,9,10},pep8 skipsdist = True [testenv] @@ -20,6 +20,7 @@ passenv = HOME setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning +envdir = {toxworkdir}/testenv deps = -r{toxinidir}/requirements.txt -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt @@ -31,6 +32,18 @@ commands = {envpython} -m stestr --version {envpython} -m stestr run {posargs} +[testenv:py37] +envdir = {toxworkdir}/testenvpy37 + +[testenv:py38] +envdir = {toxworkdir}/testenvpy38 + +[testenv:py39] +envdir = {toxworkdir}/testenvpy39 + +[testenv:py310] +envdir = {toxworkdir}/testenvpy310 + [testenv:integration] ; Warning running integration tests will make changes to your docker system! ; These tests should only be run by the integration-test docker container. @@ -56,10 +69,6 @@ commands = setenv = VIRTUAL_ENV={envdir} PYTHON={envpython} -m coverage run --source tangostationcontrol --parallel-mode -deps = - -r{toxinidir}/requirements.txt - -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt - -r{toxinidir}/test-requirements.txt commands = {envpython} -m stestr --version {envpython} -m coverage --version @@ -93,6 +102,7 @@ commands = {envpython} -m xenon tangostationcontrol -b B -m A -a A -i libhdbpp-python [testenv:docs] +envdir = {toxworkdir}/docs deps = -r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt -r{toxinidir}/docs/docs-requirements.txt