Skip to content

Commit

Permalink
cqfd: refactor cqfd
Browse files Browse the repository at this point in the history
Bump to Ubuntu 22.04.
Except Ansible, install Ruby and Python packages from Ubuntu repository.
Indent with spaces.

Signed-off-by: Mathieu Dupré <[email protected]>
  • Loading branch information
dupremathieu authored and eroussy committed May 26, 2023
1 parent 8e2e95d commit 728006c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 29 deletions.
45 changes: 26 additions & 19 deletions .cqfd/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
# 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

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
35 changes: 35 additions & 0 deletions .cqfd/docker/check_yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 0 additions & 10 deletions .cqfd/docker/requirements.txt

This file was deleted.

0 comments on commit 728006c

Please sign in to comment.