mirror of
https://github.com/linuxserver/docker-heimdall.git
synced 2026-04-11 05:09:46 +09:00
Compare commits
4 Commits
v2.7.6-ls3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83e9ee723c | ||
|
|
69f8714750 | ||
|
|
fb0817506c | ||
|
|
812f33861c |
172
Jenkinsfile
vendored
172
Jenkinsfile
vendored
@@ -78,6 +78,7 @@ pipeline {
|
|||||||
'''
|
'''
|
||||||
script{
|
script{
|
||||||
env.EXIT_STATUS = ''
|
env.EXIT_STATUS = ''
|
||||||
|
env.CI_TEST_ATTEMPTED = ''
|
||||||
env.LS_RELEASE = sh(
|
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' || : ''',
|
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()
|
returnStdout: true).trim()
|
||||||
@@ -881,6 +882,7 @@ pipeline {
|
|||||||
script{
|
script{
|
||||||
env.CI_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/index.html'
|
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_JSON_URL = 'https://ci-tests.linuxserver.io/' + env.IMAGE + '/' + env.META_TAG + '/report.json'
|
||||||
|
env.CI_TEST_ATTEMPTED = 'true'
|
||||||
}
|
}
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
set -e
|
set -e
|
||||||
@@ -1083,98 +1085,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 {
|
post {
|
||||||
always {
|
always {
|
||||||
sh '''#!/bin/bash
|
script {
|
||||||
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{
|
|
||||||
env.JOB_DATE = sh(
|
env.JOB_DATE = sh(
|
||||||
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
|
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
|
||||||
returnStdout: true).trim()
|
returnStdout: true).trim()
|
||||||
@@ -1217,6 +1134,87 @@ EOF
|
|||||||
"username": "Jenkins"}' ${BUILDS_DISCORD} '''
|
"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 {
|
cleanup {
|
||||||
sh '''#! /bin/bash
|
sh '''#! /bin/bash
|
||||||
|
|||||||
@@ -79,13 +79,13 @@ libbz2 1.0.8-r6 apk
|
|||||||
libcrypto3 3.5.5-r0 apk
|
libcrypto3 3.5.5-r0 apk
|
||||||
libcurl 8.14.1-r2 apk
|
libcurl 8.14.1-r2 apk
|
||||||
libedit 20250104.3.1-r1 apk
|
libedit 20250104.3.1-r1 apk
|
||||||
libexpat 2.7.4-r0 apk
|
libexpat 2.7.5-r0 apk
|
||||||
libgcc 14.2.0-r6 apk
|
libgcc 14.2.0-r6 apk
|
||||||
libidn2 2.3.7-r0 apk
|
libidn2 2.3.7-r0 apk
|
||||||
libintl 0.24.1-r0 apk
|
libintl 0.24.1-r0 apk
|
||||||
libmd 1.1.0-r0 apk
|
libmd 1.1.0-r0 apk
|
||||||
libncursesw 6.5_p20250503-r0 apk
|
libncursesw 6.5_p20250503-r0 apk
|
||||||
libpq 17.8-r0 apk
|
libpq 17.9-r0 apk
|
||||||
libproc2 4.0.4-r3 apk
|
libproc2 4.0.4-r3 apk
|
||||||
libpsl 0.21.5-r3 apk
|
libpsl 0.21.5-r3 apk
|
||||||
libssl3 3.5.5-r0 apk
|
libssl3 3.5.5-r0 apk
|
||||||
@@ -109,7 +109,7 @@ netcat-openbsd 1.229.1-r0 apk
|
|||||||
nette/schema v1.3.2 php-composer
|
nette/schema v1.3.2 php-composer
|
||||||
nette/utils v4.0.7 php-composer
|
nette/utils v4.0.7 php-composer
|
||||||
nghttp2-libs 1.65.0-r0 apk
|
nghttp2-libs 1.65.0-r0 apk
|
||||||
nginx 1.28.2-r0 apk
|
nginx 1.28.3-r0 apk
|
||||||
nikic/php-parser v5.5.0 php-composer
|
nikic/php-parser v5.5.0 php-composer
|
||||||
nunomaduro/collision v8.5.0 php-composer
|
nunomaduro/collision v8.5.0 php-composer
|
||||||
nunomaduro/termwind v2.3.1 php-composer
|
nunomaduro/termwind v2.3.1 php-composer
|
||||||
@@ -235,7 +235,7 @@ symfony/var-exporter v7.3.0 php-composer
|
|||||||
symfony/yaml v7.3.1 php-composer
|
symfony/yaml v7.3.1 php-composer
|
||||||
theseer/tokenizer 1.2.3 php-composer
|
theseer/tokenizer 1.2.3 php-composer
|
||||||
tijsverkoyen/css-to-inline-styles v2.3.0 php-composer
|
tijsverkoyen/css-to-inline-styles v2.3.0 php-composer
|
||||||
tzdata 2025c-r0 apk
|
tzdata 2026a-r0 apk
|
||||||
utmps-libs 0.1.3.1-r0 apk
|
utmps-libs 0.1.3.1-r0 apk
|
||||||
vlucas/phpdotenv v5.6.2 php-composer
|
vlucas/phpdotenv v5.6.2 php-composer
|
||||||
voku/portable-ascii 2.0.3 php-composer
|
voku/portable-ascii 2.0.3 php-composer
|
||||||
|
|||||||
Reference in New Issue
Block a user