Skip to content

Commit

Permalink
Fix various deprecation on CI to restart maintenance (ansible-ThoTeam…
Browse files Browse the repository at this point in the history
…#393)

Major work on CI to fix many deprecation and problems preventing it from running. Current PRs will be rebased so they can be checked. This work includes (see PR commit details for more information

* Upgrade travis configuration
* Fix and refactor for molecule lint being deprecated
  - Run linting directly from travis
  - Remove now useless default scenario
  - Add flake8 as pre-commit (and update hooks versions)
  - Update ansible lint hook option --write > --fix
  - Fix new ansible lint rule regarding reserved var names (args > call_args for call_script)
* Move molecule docker driver to molecule-plugins
* Manage testinfra tests in scenarios with symlinks to DRY
* Fix several regressions on apt test
* Upgrade CI platforms:
  - Totally deprecate centos
  - Welcome to rockylinux as a close friend to RHEL platforms
  - Add debian bookwork, deprecate buster
  - Run CI on rockylinux9 and Debian Bookworm
  • Loading branch information
zeitounator authored Dec 13, 2023
1 parent 71c0e15 commit a5cb752
Show file tree
Hide file tree
Showing 34 changed files with 110 additions and 574 deletions.
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-added-large-files
Expand All @@ -17,22 +17,27 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.30.0
rev: v1.33.0
hooks:
- id: yamllint
args: [--format, parsable, --strict]

- repo: https://github.com/ansible-community/ansible-lint
rev: v6.14.3
rev: v6.22.1
hooks:
- id: ansible-lint
args: [--write]
args: [--fix]
additional_dependencies:
- keyring
- jmespath
- ansible

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 23.11.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
26 changes: 14 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
branches:
only:
- main

dist: jammy
sudo: required

language: python
python: "3.10"

python: 3.9
branches:
only:
- main

cache:
pip: true
Expand All @@ -16,7 +15,7 @@ cache:

env:
global:
TRAVIS_BUILD_DIR: /home/travis/build/ansible-thoteam.nexus3-oss
- TRAVIS_BUILD_DIR=/home/travis/build/ansible-thoteam.nexus3-oss

services:
- docker
Expand All @@ -29,6 +28,7 @@ before_install:
- cd $TRAVIS_BUILD_DIR

install:
- pip install --upgrade pip
- pip install --upgrade --upgrade-strategy eager -r requirements.txt

stages:
Expand All @@ -41,15 +41,17 @@ jobs:
name: Checking overall syntax (groovy, yaml, python)
script: |-
./tests/test_groovySyntax.sh
molecule test
yamllint .
ansible-lint
flake8
- stage: test
name: Test on centos7
name: Test on rockylinux9
script: |-
molecule test -s default-centos7
molecule test -s default-rockylinux9
- stage: test
name: Test on Debian Bullseye
name: Test on Debian Bookworm
script: |-
molecule test -s default-debian_bullseye
molecule test -s default-debian_bookworm
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,15 +1093,15 @@ This role includes tests and CI integration through travis. At time being, we te
* groovy scripts syntax
* yaml syntax and coding standard (yamllint)
* ansible good practices (ansible lint)
* a set of basic deployments on 3 different linux platforms
* Centos 8
* Debian buster
* Ubuntu bionic (18.04)
* a set of basic deployments on 2 different linux platforms
* Rockylinux 9 (as a close parent of RHEL products since centos is deprecated)
* Debian 12 Bookworm

Other tests are available for older platforms but not played on CI for performance reasons:
* Centos 7
* Debian stretch
* Ubuntu xenial (16.04)
Other tests are available for older/different platforms but not played on CI for performance reasons:
* Rockylinux 8
* Debian 11 bullseye
* Ubuntu 20.04 Focal
* Ubuntu 22.04 Jammy


#### Groovy syntax
Expand Down Expand Up @@ -1129,11 +1129,14 @@ deactivate
```
Please have a look at molecule documentation (a good start is `molecule --help`) for further usage.

The current proposed scenarii refer to the tested platforms (see `molecule/` directory). If you launch a scenario ans leave the container running (i.e. using `converge` for a simple deploy), you can access the running instance from your browser at https://localhost:<linkedPort>. See the `molecule/<scenario>/molecule.yml` file for detail. As a convenience, here is the correspondence between scenarii and configured ports:
* default-centos7 => https://localhost:8090
* default-centos8 => https://localhost:8091
The current proposed scenarii refer to the tested platforms (see `molecule/` directory). If you launch a scenario
and leave the container running (i.e. using `converge` for a simple deploy), you can access the running instance
from your browser at https://localhost:<linkedPort>. See the `molecule/<scenario>/molecule.yml` file for detail.
As a convenience, here is the correspondence between scenarii and configured ports:
* default-rockylinux8 => https://localhost:8090
* default-rockylinux9 => https://localhost:8091
* efault-debian_bullseye => https://localhost:8092
* default-debian_buster => https://localhost:8093
* default-debian_bookworm => https://localhost:8093
* default-ubuntu_20.04 => https://localhost:8094
* default-ubuntu_22.04 => https://localhost:8095

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ driver:
safe_files:
- nexus-downloads

lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
- name: nexus3-oss-debian-bullseye
hostname: nexus3-oss-debian-bullseye
image: thoteam/molecule_apache_openjdk8:debian_bullseye
- name: nexus3-oss-debian-bookworm
hostname: nexus3-oss-debian-bookworm
image: thoteam/molecule_apache_openjdk8:debian_bookworm
command: lib/systemd/systemd
pull: true
pre_build_image: true
privileged: true
published_ports:
- 8092:443
- 8093:443
groups:
- nexus
networks: &nexus_networks
Expand Down
1 change: 1 addition & 0 deletions molecule/default-debian_bookworm/tests/test_apt_repo.py
107 changes: 0 additions & 107 deletions molecule/default-debian_bullseye/tests/test_apt_repo.py

This file was deleted.

23 changes: 0 additions & 23 deletions molecule/default-debian_bullseye/tests/test_default.py

This file was deleted.

6 changes: 0 additions & 6 deletions molecule/default-debian_buster/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ driver:
safe_files:
- nexus-downloads

lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
- name: nexus3-oss-debian-buster
hostname: nexus3-oss-debian-buster
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ driver:
safe_files:
- nexus-downloads

lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
- name: nexus3-oss-centos-7
hostname: nexus3-oss-centos7
image: thoteam/molecule_apache_openjdk8:centos7
- name: nexus3-oss-rockylinux8
hostname: nexus3-oss-rockylinux8
image: thoteam/molecule_apache_openjdk8:rockylinux8
pull: true
pre_build_image: true
privileged: true
Expand All @@ -29,6 +23,7 @@ platforms:
networks: &nexus_networks
- name: nexus-default
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- ${MOLECULE_PROJECT_DIRECTORY}/molecule/.nexus-downloads:/nexus-downloads

- name: slapd-server-mock
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,20 @@ driver:
safe_files:
- nexus-downloads

lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
- name: nexus3-oss-centos-8
hostname: nexus3-oss-centos8
image: thoteam/molecule_apache_openjdk8:centos8
- name: nexus3-oss-rockylinux9
hostname: nexus3-oss-rockylinux9
image: thoteam/molecule_apache_openjdk8:rockylinux9
pull: true
pre_build_image: true
privileged: true
published_ports:
- 8091:443
override_command: false
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- ${MOLECULE_PROJECT_DIRECTORY}/molecule/.nexus-downloads:/nexus-downloads
cgroupns_mode: host
groups:
- nexus
networks: &nexus_networks
Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions molecule/default-ubuntu_20.04/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ driver:
safe_files:
- nexus-downloads

lint: |
set -e
yamllint .
ansible-lint
flake8
platforms:
- name: nexus3-oss-ubuntu-20.04
hostname: nexus3-oss-ubuntu-20.04
Expand Down
Loading

0 comments on commit a5cb752

Please sign in to comment.