Commit 04df7a73 authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

feat: merge cleanup branch into master

parents f7c15254 3e715334
Loading
Loading
Loading
Loading
Loading
+10 −1
Changes for .ansible-lint: 10 added lines, 1 removed line.
Original line number Diff line number Diff line
profile: min
exclude_paths:
  - .cache/
  - .git/
  - .gitlab-ci-local/
  - .mypy_cache/
  - .venv/
  - ansible/secrets.yml
  - ansible/venv/
  - public/
  - venv/
skip_list:
  - var-naming
  - yaml[line-length]
  - run-once[task]
  - no-handler
+3 −0
Changes for .gitignore: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ ansible/.ansible/
*.retry
ansible_facts/
ansible/secrets.yml
ansible/inventory/*.local.yml

# Automation folder - contains kubeconfig files generated by ansible
automation/
@@ -34,6 +35,8 @@ Thumbs.db

# Temporary files
/tmp/
.cache/
.mypy_cache/
*.tmp
*.log

.gitlab-ci.yml

0 → 100644
+95 −0
Changes for .gitlab-ci.yml: 95 added lines, 0 removed lines.
Original line number Diff line number Diff line
image: python:3.12-slim

stages:
  - lint
  - test
  - docs
  - deploy

variables:
  ANSIBLE_CONFIG: ansible/ansible.cfg
  ANSIBLE_FORCE_COLOR: "true"
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip
    - .venv/

.ansible_setup:
  before_script:
    - python3 --version
    - pip --version 2>/dev/null || { python3 -m venv --without-pip .venv && source .venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3; }
    - pip install --upgrade pip
    - pip install -r ansible/requirements.txt
    - ansible-galaxy collection install -r ansible/requirements.yml

secret-scan:
  stage: lint
  image: alpine:latest
  before_script:
    - apk add --no-cache git
  script:
    - |
      if git grep -nE 'g[l]pat-|g[h]p_|github_[p]at_' -- . ':!ansible/secrets.example.yml'; then
        exit 1
      fi
      begin_marker='-----BEGIN '
      key_marker='PRIVATE KEY'
      if git grep -n -e "$begin_marker" -- . ':!ansible/secrets.example.yml' | grep -E "$key_marker"; then
        exit 1
      fi

yamllint:
  stage: lint
  extends: .ansible_setup
  script:
    - yamllint .

ansible-lint:
  stage: lint
  extends: .ansible_setup
  script:
    - ansible-lint -c .ansible-lint ansible/playbooks ansible/roles ansible/role-template

syntax-check:
  stage: test
  extends: .ansible_setup
  script:
    - cd ansible
    - chmod 700 .
    - ansible-playbook -i inventory/hosts.yml --syntax-check playbooks/scenarios/full_oop/deploy-kubernetes.yml
    - ansible-playbook -i inventory/hosts.yml --syntax-check playbooks/scenarios/dual_oop/deploy-kubernetes.yml
    - ansible-playbook -i inventory/hosts.yml --syntax-check playbooks/scenarios/full_oop_existing_cluster/deploy.yml

python-smoke:
  stage: test
  script:
    - python3 -m py_compile docker-local-deployment/prepare_kubeconfig.py

docs:
  stage: docs
  script:
    - python3 --version
    - pip --version 2>/dev/null || { python3 -m venv --without-pip .venv && source .venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3; }
    - pip install --upgrade pip
    - pip install -r docs/requirements.txt
    - mkdocs build --strict
  artifacts:
    paths:
      - public
    expire_in: 1 week

pages:
  stage: deploy
  script:
    - python3 --version
    - pip --version 2>/dev/null || { python3 -m venv --without-pip .venv && source .venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python3; }
    - pip install --upgrade pip
    - pip install -r docs/requirements.txt
    - mkdocs build --strict
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

.vscode/settings.json

deleted100644 → 0
+0 −6
Changes for .vscode/settings.json: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
{
    "ansible.python.interpreterPath": "./venv/bin/python",
    "ansible.ansibleLint.path": "./venv/bin/ansible-lint",
    "python-envs.pythonProjects": [],
    "ansible.mcpServer.enabled": true
}
 No newline at end of file

.yamllint

0 → 100644
+27 −0
Changes for .yamllint: 27 added lines, 0 removed lines.
Original line number Diff line number Diff line
---
extends: default

ignore: |
  .cache/
  .git/
  .gitlab-ci-local/
  .mypy_cache/
  .venv/
  ansible/secrets.yml
  ansible/venv/
  public/
  venv/

rules:
  braces:
    max-spaces-inside: 1
  comments:
    min-spaces-from-content: 1
  comments-indentation: disable
  document-start: disable
  line-length: disable
  octal-values:
    forbid-implicit-octal: true
    forbid-explicit-octal: true
  truthy:
    allowed-values: ["true", "false"]
Loading