From ec1b1d21845e582e947c348e52d7a89f1c7ad132 Mon Sep 17 00:00:00 2001 From: fejao <mail@fejao.de> Date: Tue, 28 Jan 2025 14:38:31 +0100 Subject: [PATCH] Updating .gitlab-ci.yml file --- .gitlab-ci.yml | 235 ++++++++++++++++++++++++++----------------------- 1 file changed, 126 insertions(+), 109 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0244e7f..622813d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,121 +17,121 @@ stages: - lint-tests - molecule -### -### SYNTAX-CHECK -### -syntax-test: - stage: syntax-check - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-playbook --syntax-check tests at the role-> 'test'" - - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_TEST - allow_failure: false +# ### +# ### SYNTAX-CHECK +# ### +# syntax-test: +# stage: syntax-check +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-playbook --syntax-check tests at the role-> 'test'" +# - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_TEST +# allow_failure: false -syntax-dependencies: - stage: syntax-check - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-playbook --syntax-check tests at the role-> 'dependencies'" - - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_DEPENDENCIES - allow_failure: false +# syntax-dependencies: +# stage: syntax-check +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-playbook --syntax-check tests at the role-> 'dependencies'" +# - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_DEPENDENCIES +# allow_failure: false -syntax-clone-repositories: - stage: syntax-check - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-playbook --syntax-check tests at the role-> 'clone_repositories'" - - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_CLONE_REPOSITORIES - allow_failure: false +# syntax-clone-repositories: +# stage: syntax-check +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-playbook --syntax-check tests at the role-> 'clone_repositories'" +# - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_CLONE_REPOSITORIES +# allow_failure: false -syntax-docker-images: - stage: syntax-check - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-playbook --syntax-check tests at the role-> 'docker_images'" - - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_DOCKER_IMAGES - allow_failure: false +# syntax-docker-images: +# stage: syntax-check +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-playbook --syntax-check tests at the role-> 'docker_images'" +# - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_DOCKER_IMAGES +# allow_failure: false -syntax-docker-containers: - stage: syntax-check - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-playbook --syntax-check tests at the role-> 'docker_containers'" - - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_DOCKER_CONTAINERS - allow_failure: false +# syntax-docker-containers: +# stage: syntax-check +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-playbook --syntax-check tests at the role-> 'docker_containers'" +# - ansible-playbook --syntax-check -i $INVENTORIES_PATH $PLAYBOOK_PATH_FOR_ROLE_DOCKER_CONTAINERS +# allow_failure: false -### -### LINT-TESTS -### -lint-test: - stage: lint-tests - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-lint tests at the role-> 'test'" - - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_TEST - allow_failure: false +# ### +# ### LINT-TESTS +# ### +# lint-test: +# stage: lint-tests +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-lint tests at the role-> 'test'" +# - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_TEST +# allow_failure: false -lint-dependencies: - stage: lint-tests - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-lint tests at the role-> 'dependencies'" - - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_DEPENDENCIES - allow_failure: false +# lint-dependencies: +# stage: lint-tests +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-lint tests at the role-> 'dependencies'" +# - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_DEPENDENCIES +# allow_failure: false -lint-clone-repositories: - stage: lint-tests - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-lint tests at the role-> 'clone_repositories'" - - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_CLONE_REPOSITORIES - allow_failure: false +# lint-clone-repositories: +# stage: lint-tests +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-lint tests at the role-> 'clone_repositories'" +# - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_CLONE_REPOSITORIES +# allow_failure: false -lint-docker-images: - stage: lint-tests - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-lint tests at the role-> 'docker_images'" - - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_DOCKER_IMAGES - allow_failure: false +# lint-docker-images: +# stage: lint-tests +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-lint tests at the role-> 'docker_images'" +# - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_DOCKER_IMAGES +# allow_failure: false -lint-docker-containers: - stage: lint-tests - image: python:3.10.15-bullseye - before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* - - pip3 install -r ci-cd/requirements.txt - script: - - echo "Running ansible-lint tests at the role-> 'docker_containers'" - - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_DOCKER_CONTAINERS - allow_failure: false +# lint-docker-containers: +# stage: lint-tests +# image: python:3.10.15-bullseye +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# script: +# - echo "Running ansible-lint tests at the role-> 'docker_containers'" +# - ansible-lint $PLAYBOOK_PATH_FOR_ROLE_DOCKER_CONTAINERS +# allow_failure: false ### @@ -139,15 +139,32 @@ lint-docker-containers: ### molecule-test: stage: molecule - image: docker:latest + # image: docker:latest + image: docker:27.5.1-alpine3.21 before_script: - - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* + # - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* + - apk add --no-cache python3 py3-pip - pip3 install -r ci-cd/requirements.txt - pip3 install --upgrade molecule molecule-docker - # - python3 -m pip install --user "molecule-plugins[docker] - pip3 install --user "molecule-plugins[docker]" script: - echo "Running ansible-lint tests at the role-> 'test'" - cd roles/test - molecule test allow_failure: false + +# molecule-test: +# stage: molecule +# # image: docker:latest +# image: docker:27.5.1-alpine3.21 +# before_script: +# - apt-get update && apt-get install -y python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/* +# - pip3 install -r ci-cd/requirements.txt +# - pip3 install --upgrade molecule molecule-docker +# # - python3 -m pip install --user "molecule-plugins[docker] +# - pip3 install --user "molecule-plugins[docker]" +# script: +# - echo "Running ansible-lint tests at the role-> 'test'" +# - cd roles/test +# - molecule test +# allow_failure: false -- GitLab