diff --git a/Jenkinsfile b/Jenkinsfile index b4fb77c..f0e1f0d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -77,6 +77,7 @@ pipeline { ''' script{ env.EXIT_STATUS = '' + env.CI_TEST_ATTEMPTED = '' env.LS_RELEASE = sh( script: '''docker run --rm quay.io/skopeo/stable:v1 inspect docker://ghcr.io/${LS_USER}/${CONTAINER_NAME}:latest 2>/dev/null | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''', returnStdout: true).trim() @@ -873,6 +874,7 @@ pipeline { script{ env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html' env.CI_JSON_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/report.json' + env.CI_TEST_ATTEMPTED = 'true' } sh '''#! /bin/bash set -e @@ -1075,98 +1077,13 @@ EOF ) ''' } } - // If this is a Pull request send the CI link as a comment on it - stage('Pull Request Comment') { - when { - not {environment name: 'CHANGE_ID', value: ''} - environment name: 'EXIT_STATUS', value: '' - } - steps { - sh '''#! /bin/bash - # Function to retrieve JSON data from URL - get_json() { - local url="$1" - local response=$(curl -s "$url") - if [ $? -ne 0 ]; then - echo "Failed to retrieve JSON data from $url" - return 1 - fi - local json=$(echo "$response" | jq .) - if [ $? -ne 0 ]; then - echo "Failed to parse JSON data from $url" - return 1 - fi - echo "$json" - } - - build_table() { - local data="$1" - - # Get the keys in the JSON data - local keys=$(echo "$data" | jq -r 'to_entries | map(.key) | .[]') - - # Check if keys are empty - if [ -z "$keys" ]; then - echo "JSON report data does not contain any keys or the report does not exist." - return 1 - fi - - # Build table header - local header="| Tag | Passed |\\n| --- | --- |\\n" - - # Loop through the JSON data to build the table rows - local rows="" - for build in $keys; do - local status=$(echo "$data" | jq -r ".[\\"$build\\"].test_success") - if [ "$status" = "true" ]; then - status="✅" - else - status="❌" - fi - local row="| "$build" | "$status" |\\n" - rows="${rows}${row}" - done - - local table="${header}${rows}" - local escaped_table=$(echo "$table" | sed 's/\"/\\\\"/g') - echo "$escaped_table" - } - - if [[ "${CI}" = "true" ]]; then - # Retrieve JSON data from URL - data=$(get_json "$CI_JSON_URL") - # Create table from JSON data - table=$(build_table "$data") - echo -e "$table" - - curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ - -d "{\\"body\\": \\"I am a bot, here are the test results for this PR: \\n${CI_URL}\\n${SHELLCHECK_URL}\\n${table}\\"}" - else - curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ - -d "{\\"body\\": \\"I am a bot, here is the pushed image/manifest for this PR: \\n\\n\\`${GITHUBIMAGE}:${META_TAG}\\`\\"}" - fi - ''' - - } - } } /* ###################### - Send status to Discord + Comment on PR and Send status to Discord ###################### */ post { always { - sh '''#!/bin/bash - rm -rf /config/.ssh/id_sign - rm -rf /config/.ssh/id_sign.pub - git config --global --unset gpg.format - git config --global --unset user.signingkey - git config --global --unset commit.gpgsign - ''' - script{ + script { env.JOB_DATE = sh( script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''', returnStdout: true).trim() @@ -1209,6 +1126,87 @@ EOF "username": "Jenkins"}' ${BUILDS_DISCORD} ''' } } + script { + if (env.GITHUBIMAGE =~ /lspipepr/){ + if (env.CI_TEST_ATTEMPTED == "true"){ + sh '''#! /bin/bash + # Function to retrieve JSON data from URL + get_json() { + local url="$1" + local response=$(curl -s "$url") + if [ $? -ne 0 ]; then + echo "Failed to retrieve JSON data from $url" + return 1 + fi + local json=$(echo "$response" | jq .) + if [ $? -ne 0 ]; then + echo "Failed to parse JSON data from $url" + return 1 + fi + echo "$json" + } + + build_table() { + local data="$1" + + # Get the keys in the JSON data + local keys=$(echo "$data" | jq -r 'to_entries | map(.key) | .[]') + + # Check if keys are empty + if [ -z "$keys" ]; then + echo "JSON report data does not contain any keys or the report does not exist." + return 1 + fi + + # Build table header + local header="| Tag | Passed |\\n| --- | --- |\\n" + + # Loop through the JSON data to build the table rows + local rows="" + for build in $keys; do + local status=$(echo "$data" | jq -r ".[\\"$build\\"].test_success") + if [ "$status" = "true" ]; then + status="✅" + else + status="❌" + fi + local row="| "$build" | "$status" |\\n" + rows="${rows}${row}" + done + + local table="${header}${rows}" + local escaped_table=$(echo "$table" | sed 's/\"/\\\\"/g') + echo "$escaped_table" + } + + if [[ "${CI}" = "true" ]]; then + # Retrieve JSON data from URL + data=$(get_json "$CI_JSON_URL") + # Create table from JSON data + table=$(build_table "$data") + echo -e "$table" + + curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ + -d "{\\"body\\": \\"I am a bot, here are the test results for this PR: \\n${CI_URL}\\n${SHELLCHECK_URL}\\n${table}\\"}" + else + curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/$LS_USER/$LS_REPO/issues/$PULL_REQUEST/comments" \ + -d "{\\"body\\": \\"I am a bot, here is the pushed image/manifest for this PR: \\n\\n\\`${GITHUBIMAGE}:${META_TAG}\\`\\"}" + fi + ''' + } + } + } + sh '''#!/bin/bash + rm -rf /config/.ssh/id_sign + rm -rf /config/.ssh/id_sign.pub + git config --global --unset gpg.format + git config --global --unset user.signingkey + git config --global --unset commit.gpgsign + ''' } cleanup { sh '''#! /bin/bash diff --git a/package_versions.txt b/package_versions.txt index d6deaa3..d36b5b4 100755 --- a/package_versions.txt +++ b/package_versions.txt @@ -34,7 +34,7 @@ grep 3.11-4build1 deb gzip 1.12-1ubuntu3.1 deb hostname 3.23+nmu2ubuntu2 deb init-system-helpers 1.66ubuntu1 deb -jq 1.7.1-3ubuntu0.24.04.1 deb +jq 1.7.1-3ubuntu0.24.04.2 deb keyboxd 2.4.4-2ubuntu17.4 deb krb5-locales 1.20.1-6ubuntu2.6 deb libacl1 2.3.2-1build1.1 deb @@ -50,7 +50,7 @@ libbz2-1.0 1.0.8-5.1build0.1 deb libc-bin 2.39-0ubuntu8.7 deb libc6 2.39-0ubuntu8.7 deb libcap-ng0 0.8.4-2build2 deb -libcap2 1:2.66-5ubuntu2.2 deb +libcap2 1:2.66-5ubuntu2.4 deb libcom-err2 1.47.0-2.4~exp1ubuntu4.1 deb libcrypt1 1:4.4.36-4build1 deb libcurl4t64 8.5.0-2ubuntu10.8 deb @@ -66,10 +66,10 @@ libgpg-error0 1.47-3build2.1 deb libgssapi-krb5-2 1.20.1-6ubuntu2.6 deb libhogweed6t64 3.9.1-2.2build1.1 deb libidn2-0 2.3.7-2build1.1 deb -libjq1 1.7.1-3ubuntu0.24.04.1 deb +libjq1 1.7.1-3ubuntu0.24.04.2 deb libk5crypto3 1.20.1-6ubuntu2.6 deb libkeyutils1 1.6.3-3build1 deb -libkmod2 31+20240202-2ubuntu7.1 deb +libkmod2 31+20240202-2ubuntu7.2 deb libkrb5-3 1.20.1-6ubuntu2.6 deb libkrb5support0 1.20.1-6ubuntu2.6 deb libksba8 1.6.6-1build1 deb @@ -106,12 +106,12 @@ libsmartcols1 2.39.3-9ubuntu6.5 deb libsqlite3-0 3.45.1-1ubuntu2.5 deb libss2 1.47.0-2.4~exp1ubuntu4.1 deb libssh-4 0.10.6-2ubuntu0.4 deb -libssl3t64 3.0.13-0ubuntu3.7 deb +libssl3t64 3.0.13-0ubuntu3.9 deb libstdc++6 14.2.0-4ubuntu2~24.04.1 deb -libsystemd0 255.4-1ubuntu8.14 deb +libsystemd0 255.4-1ubuntu8.15 deb libtasn1-6 4.19.0-3ubuntu0.24.04.2 deb libtinfo6 6.4+20240113-1ubuntu2 deb -libudev1 255.4-1ubuntu8.14 deb +libudev1 255.4-1ubuntu8.15 deb libunistring5 1.1-2build1.1 deb libuuid1 2.39.3-9ubuntu6.5 deb libxxhash0 0.8.2-2build1 deb @@ -124,24 +124,24 @@ mount 2.39.3-9ubuntu6.5 deb ncurses-base 6.4+20240113-1ubuntu2 deb ncurses-bin 6.4+20240113-1ubuntu2 deb netcat-openbsd 1.226-1ubuntu2 deb -openssl 3.0.13-0ubuntu3.7 deb +openssl 3.0.13-0ubuntu3.9 deb passwd 1:4.13+dfsg1-4ubuntu3.2 deb perl-base 5.38.2-3.2ubuntu0.2 deb pinentry-curses 1.2.1-3ubuntu5 deb -plexmediaserver 1.43.0.10492-121068a07 deb +plexmediaserver 1.43.1.10611-1e34174b1 deb procps 2:4.0.4-4ubuntu3.2 deb publicsuffix 20231001.0357-0.1 deb readline-common 8.2-4build1 deb sed 4.9-2build1 deb sensible-utils 0.0.22 deb -systemd-dev 255.4-1ubuntu8.14 deb +systemd-dev 255.4-1ubuntu8.15 deb systemd-hwe-hwdb 255.1.7 deb -systemd-standalone-sysusers 255.4-1ubuntu8.14 deb +systemd-standalone-sysusers 255.4-1ubuntu8.15 deb sysvinit-utils 3.08-6ubuntu3 deb tar 1.35+dfsg-3build1 deb -tzdata 2025b-0ubuntu0.24.04.1 deb +tzdata 2026a-0ubuntu0.24.04.1 deb ubuntu-keyring 2023.11.28.1 deb -udev 255.4-1ubuntu8.14 deb +udev 255.4-1ubuntu8.15 deb unminimize 0.2.1 deb util-linux 2.39.3-9ubuntu6.5 deb wget 1.21.4-1ubuntu4.1 deb