Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
81e60e628f | |||
4760c0a613 |
8 changed files with 184 additions and 46 deletions
14
.drone.yml
Normal file
14
.drone.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
kind: pipeline
|
||||
name: deploy
|
||||
steps:
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
repo: aaronriedel/ansible-lint
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_COMMIT_SHA:0:8}
|
|
@ -1,39 +0,0 @@
|
|||
steps:
|
||||
- name: docker
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
privileged: true
|
||||
settings:
|
||||
registry: git.ar21.de
|
||||
username:
|
||||
from_secret: REGISTRY_USER
|
||||
password:
|
||||
from_secret: REGISTRY_PASS
|
||||
repo: git.ar21.de/aaron/ansible-lint
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_PIPELINE_NUMBER}
|
||||
platforms:
|
||||
- linux/arm64
|
||||
- linux/amd64
|
||||
when:
|
||||
- branch: main
|
||||
event: [push, manual]
|
||||
- name: docker-build
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
privileged: true
|
||||
settings:
|
||||
registry: git.ar21.de
|
||||
username:
|
||||
from_secret: REGISTRY_USER
|
||||
password:
|
||||
from_secret: REGISTRY_PASS
|
||||
repo: git.ar21.de/aaron/ansible-lint
|
||||
tags: latest
|
||||
platforms:
|
||||
- linux/arm64
|
||||
- linux/amd64
|
||||
dry_run: true
|
||||
when:
|
||||
- branch:
|
||||
exclude: main
|
||||
event: [push, manual]
|
|
@ -1,5 +1,5 @@
|
|||
FROM python:3.13.0-slim-bullseye
|
||||
RUN apt-get update -qq && apt-get install -qq git --no-install-recommends && rm -rf /var/lib/apt/lists/*
|
||||
FROM amd64/python:3.11.2-alpine3.16
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR ./
|
||||
ARG PUID=1000
|
||||
ENV GROUP dockergroup
|
||||
|
@ -7,7 +7,7 @@ ENV USER docker
|
|||
ENV HOMEDIR "/home/${USER}"
|
||||
ENV PATH ${HOMEDIR}/.local/bin:$PATH
|
||||
ENV PLUGIN_PROFILE production
|
||||
RUN useradd -u "${PUID}" -m "${USER}"
|
||||
RUN addgroup -S "${GROUP}" && adduser -S "${USER}" -G "${GROUP}"
|
||||
COPY script.sh /bin/
|
||||
RUN chmod +x /bin/script.sh
|
||||
USER ${USER}
|
||||
|
@ -15,5 +15,8 @@ WORKDIR ${HOMEDIR}
|
|||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN rm requirements.txt
|
||||
RUN git config --global --add safe.directory /drone/src
|
||||
COPY card.json .
|
||||
COPY card.data.json .
|
||||
|
||||
ENTRYPOINT [ "script.sh" ]
|
|
@ -1 +1 @@
|
|||
[![status-badge](https://woodpecker.ar21.de/api/badges/12/status.svg)](https://woodpecker.ar21.de/repos/12)
|
||||
[![Build Status](https://drone.ar21.de/api/badges/aaron/ansible-lint/status.svg)](https://drone.ar21.de/aaron/ansible-lint)
|
9
card.data.json
Normal file
9
card.data.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"Issues": {
|
||||
"critical": 3,
|
||||
"high": 2,
|
||||
"medium": 0,
|
||||
"low": 43
|
||||
},
|
||||
"path": "test/test"
|
||||
}
|
146
card.json
Normal file
146
card.json
Normal file
|
@ -0,0 +1,146 @@
|
|||
{
|
||||
"type": "AdaptiveCard",
|
||||
"body": [
|
||||
{
|
||||
"type": "ColumnSet",
|
||||
"columns": [
|
||||
{
|
||||
"type": "Column",
|
||||
"items": [
|
||||
{
|
||||
"type": "Image",
|
||||
"url": "https://raw.githubusercontent.com/ansible/logos/main/vscode-ansible.png",
|
||||
"size": "Small"
|
||||
}
|
||||
],
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"items": [
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"text": "ansible-lint",
|
||||
"wrap": true,
|
||||
"size": "Small",
|
||||
"weight": "Bolder",
|
||||
"isSubtle": false,
|
||||
"spacing": "Small"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"text": "Repo: ${$root.path}",
|
||||
"wrap": true,
|
||||
"size": "Small",
|
||||
"weight": "Lighter",
|
||||
"isSubtle": true,
|
||||
"spacing": "Small"
|
||||
}
|
||||
],
|
||||
"width": "stretch"
|
||||
}
|
||||
],
|
||||
"style": "default"
|
||||
},
|
||||
{
|
||||
"type": "ColumnSet",
|
||||
"columns": [
|
||||
{
|
||||
"type": "Column",
|
||||
"separator": true,
|
||||
"width": "auto",
|
||||
"items": [
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Large",
|
||||
"$data": "${$root.Issues.critical}",
|
||||
"text": "${formatNumber($root.Issues.critical, 0)}",
|
||||
"wrap": true,
|
||||
"horizontalAlignment": "Center",
|
||||
"spacing": "None",
|
||||
"color": "Attention"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Small",
|
||||
"text": "Critical Severity"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"width": "auto",
|
||||
"separator": true,
|
||||
"spacing": "Medium",
|
||||
"items": [
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Large",
|
||||
"$data": "${$root.Issues.high}",
|
||||
"text": "${formatNumber($root.Issues.high, 0)}",
|
||||
"wrap": true,
|
||||
"horizontalAlignment": "Center",
|
||||
"spacing": "None",
|
||||
"color": "Warning"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Small",
|
||||
"text": "High Severity"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"width": "auto",
|
||||
"separator": true,
|
||||
"spacing": "Medium",
|
||||
"items": [
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Large",
|
||||
"$data": "${$root.Issues.medium}",
|
||||
"text": "${formatNumber($root.Issues.medium, 0)}",
|
||||
"wrap": true,
|
||||
"horizontalAlignment": "Center",
|
||||
"spacing": "None",
|
||||
"color": "Accent"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Small",
|
||||
"text": "Medium Severity"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"width": "auto",
|
||||
"separator": true,
|
||||
"spacing": "Medium",
|
||||
"items": [
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Large",
|
||||
"$data": "${$root.Issues.low}",
|
||||
"text": "${formatNumber($root.Issues.low, 0)}",
|
||||
"wrap": true,
|
||||
"horizontalAlignment": "Center",
|
||||
"spacing": "None",
|
||||
"color": "Good"
|
||||
},
|
||||
{
|
||||
"type": "TextBlock",
|
||||
"size": "Small",
|
||||
"text": "Low Severity"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"style": "default",
|
||||
"separator": true
|
||||
}
|
||||
],
|
||||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
|
||||
"version": "1.5"
|
||||
}
|
|
@ -1,2 +1,2 @@
|
|||
ansible==10.6.0
|
||||
ansible-lint==24.10.0
|
||||
ansible==7.3.0
|
||||
ansible-lint==6.12.2
|
||||
|
|
|
@ -2,4 +2,9 @@
|
|||
|
||||
echo "Starting ansible linter by Aaron Riedel"
|
||||
echo ""
|
||||
cd /drone/src
|
||||
ansible-lint --profile $PLUGIN_PROFILE
|
||||
echo ""
|
||||
cat ~/card.json
|
||||
echo ""
|
||||
cat ~/card.data.json
|
Loading…
Reference in a new issue