From 4760c0a61363904010081f257dc43dcb09d2abe3 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 13 Mar 2023 12:42:58 +0100 Subject: [PATCH 1/2] test cards --- Dockerfile | 2 ++ script.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index da1c332..cc7014d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,7 @@ 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" ] \ No newline at end of file diff --git a/script.sh b/script.sh index d5ae11d..8a5e999 100644 --- a/script.sh +++ b/script.sh @@ -3,4 +3,8 @@ echo "Starting ansible linter by Aaron Riedel" echo "" cd /drone/src -ansible-lint --profile $PLUGIN_PROFILE \ No newline at end of file +ansible-lint --profile $PLUGIN_PROFILE +echo "" +cat ~/card.json +echo "" +cat ~/card.data.json \ No newline at end of file From 81e60e628fdfb0305cbbce79477bb1ea2950302a Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 13 Mar 2023 12:43:59 +0100 Subject: [PATCH 2/2] add card example --- card.data.json | 9 +++ card.json | 146 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 card.data.json create mode 100644 card.json diff --git a/card.data.json b/card.data.json new file mode 100644 index 0000000..f51061d --- /dev/null +++ b/card.data.json @@ -0,0 +1,9 @@ +{ + "Issues": { + "critical": 3, + "high": 2, + "medium": 0, + "low": 43 + }, + "path": "test/test" +} \ No newline at end of file diff --git a/card.json b/card.json new file mode 100644 index 0000000..1b1ef5b --- /dev/null +++ b/card.json @@ -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" +} \ No newline at end of file