feat(ci): added yamllint

This commit is contained in:
Simon Cornet 2025-06-06 13:40:11 +02:00
commit d37dc36faa
3 changed files with 29 additions and 12 deletions

View file

@ -13,17 +13,20 @@ deployment:
# prepare ssh # prepare ssh
before_script: before_script:
# prepare ssh # prepare ssh
- | - |
# prepare ssh # prepare ssh
mkdir -p ~/.ssh mkdir -p ~/.ssh
chmod 700 ~/.ssh chmod 700 ~/.ssh
echo "$SSH_CONFIG" > ~/.ssh/config echo "$SSH_CONFIG" > ~/.ssh/config
echo "$SSH_DEPLOYMENT_KEY" > ~/.ssh/id_ed25519 echo "$SSH_DEPLOYMENT_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519
# deployment commands # deployment commands
script: script:
- | - |
# install ansible roles dependancies # install ansible roles dependancies
ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER "sudo /usr/local/bin/ansible-galaxy install -r /etc/ansible/roles/requirements.yaml --force" ssh $SSH_DEPLOYMENT_USER@$ANSIBLE_SERVER \
"sudo /usr/local/bin/ansible-galaxy install -r /etc/ansible/roles/requirements.yaml --force"

View file

@ -1,10 +1,9 @@
--- ---
# linting # linting
linting: ansible-lint:
stage: "linting" stage: "linting"
image: image: "docker.io/pipelinecomponents/ansible-lint:0.79.0"
name: "docker.io/pipelinecomponents/ansible-lint:0.79.0"
rules: rules:
# run only on push to default branch # run only on push to default branch
@ -14,3 +13,18 @@ linting:
# start linting # start linting
script: script:
- "ansible-lint -c .ansible-lint ." - "ansible-lint -c .ansible-lint ."
# yamllint
yamllint:
stage: "linting"
image: "registry.gitlab.com/pipeline-components/yamllint:0.35.0"
rules:
# run only on push to default branch
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- when: "never"
script:
# run yamllint
- "yamllint ."

View file

@ -1,6 +1,6 @@
--- ---
# splunk universal forwarder installer deb # splunk universal forwarder installer deb
splunk_forwarder_deb: splunk_forwarder_deb:
"https://download.splunk.com/products/universalforwarder/releases/9.4.2/\ "https://download.splunk.com/products/universalforwarder/releases/9.4.2/\
linux/splunkforwarder-9.4.2-e9664af3d956-linux-amd64.deb" linux/splunkforwarder-9.4.2-e9664af3d956-linux-amd64.deb"