diff --git a/.cqfd/docker/Dockerfile b/.cqfd/docker/Dockerfile index fcd42438d..7742ad22d 100644 --- a/.cqfd/docker/Dockerfile +++ b/.cqfd/docker/Dockerfile @@ -1,7 +1,7 @@ # Copyright (C) 2021, RTE (http://www.rte-france.com) # SPDX-License-Identifier: Apache-2.0 -FROM ubuntu:20.04 +FROM ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -9,22 +9,29 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 ENV LC_ALL en_US.UTF-8 -RUN apt-get update && apt-get install -y \ - bash \ - locales \ - ruby \ - git \ - ssh \ - python3-libvirt \ - docker.io \ - docker-compose \ - python3-pip +RUN set -x \ + && apt-get update \ + && apt-get install -y \ + bash \ + docker.io \ + docker-compose \ + git \ + locales \ + python3-docutils \ + python3-libvirt \ + python3-netaddr \ + python3-pip \ + python3-pygments \ + python3-sphinx \ + python3-sphinx-notfound-page \ + rstcheck \ + ruby-asciidoctor-pdf \ + ssh \ + yamllint \ + && sed -i "s/# en_US\.UTF-8 UTF-8/en_US\.UTF-8 UTF-8/" /etc/locale.gen \ + && locale-gen \ + && dpkg-reconfigure locales \ + && pip install "ansible>=2.9,<2.10,!=2.9.10" \ + && rm -rf /var/lib/{apt,dpkg,cache,log}/* -RUN sed -i "s/# en_US\.UTF-8 UTF-8/en_US\.UTF-8 UTF-8/" /etc/locale.gen -RUN locale-gen -RUN dpkg-reconfigure locales -# Asciidoctor PDF generator for generating the manual -RUN gem install asciidoctor-pdf --pre -v 1.5.0.rc2 -ADD check_yaml.sh /usr/bin/check_yaml -ADD requirements.txt /tmp/requirements.txt -RUN python3 -m pip install -r /tmp/requirements.txt +COPY check_yaml.sh /usr/bin/check_yaml diff --git a/.cqfd/docker/check_yaml.sh b/.cqfd/docker/check_yaml.sh index 5e1b9d5db..e396bd7f5 100755 --- a/.cqfd/docker/check_yaml.sh +++ b/.cqfd/docker/check_yaml.sh @@ -17,6 +17,41 @@ find_yaml() "^${1}/(ceph-ansible|roles/corosync|roles/systemd_networkd|collections)" } +# Name C +# Brief Print colorized string +# arg1 color name (see below) +# arg2 string +C() +{ + local color="$1"; shift + local text="$*" + local nc='\033[0m' + local c + + # Only colorize a few terminal types + case "$TERM" in + linux*|xterm*|screen|vt102) ;; + *) + echo "$@" + return + ;; + esac + + case "$color" in + gray) c='\033[1;30m' ;; + red) c='\033[1;31m' ;; + green) c='\033[1;32m' ;; + yellow) c='\033[1;33m' ;; + blue) c='\033[1;34m' ;; + purple) c='\033[1;35m' ;; + cyan) c='\033[1;36m' ;; + + orange_bg) c='\033[48;2;255;165;0m' + esac + + printf "${c}${text}${nc}" +} + directory="." warns="--no-warnings" diff --git a/.cqfd/docker/requirements.txt b/.cqfd/docker/requirements.txt deleted file mode 100644 index 337c23c8d..000000000 --- a/.cqfd/docker/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) 2021, RTE (http://www.rte-france.com) -# SPDX-License-Identifier: Apache-2.0 -rstcheck -sphinx -sphinx-notfound-page -Pygments >= 2.4.0 -docutils == 0.16 -ansible >=2.9,<2.10 -yamllint -netaddr